gpt4 book ai didi

python - 每次我运行 "jupyter notebook"时,为什么我总是在 mac os 上得到这个?

转载 作者:行者123 更新时间:2023-12-01 16:55:59 32 4
gpt4 key购买 nike

每次我在 mac 操作系统上运行“jupyter notebook”时,为什么总是出现此错误?

案例:

  1. 我有 python2.x 并且安装了 python3.7 (所以,我这里有两个命令)
  2. 我用 pip 安装了 jupyter
  3. 当我输入 jupyter Notebook 命令时,我总是收到这些错误

错误:

Traceback (most recent call last):
File "/Library/Frameworks/Python.framework/Versions/3.7/bin/jupyter-notebook", line 11, in <module>
sys.exit(main())
File "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/jupyter_core/application.py", line 266, in launch_instance
return super(JupyterApp, cls).launch_instance(argv=argv, **kwargs)
File "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/traitlets/config/application.py", line 658, in launch_instance
app.start()
File "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/notebook/notebookapp.py", line 1697, in start
browser = webbrowser.get(self.browser or None)
File "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/webbrowser.py", line 42, in get
register_standard_browsers()
File "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/webbrowser.py", line 531, in register_standard_browsers
raw_result = subprocess.check_output(cmd, stderr=subprocess.DEVNULL)
File "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/subprocess.py", line 376, in check_output
**kwargs).stdout
File "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/subprocess.py", line 453, in run
with Popen(*popenargs, **kwargs) as process:
File "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/subprocess.py", line 756, in __init__
restore_signals, start_new_session)
File "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/subprocess.py", line 1499, in _execute_child
raise child_exception_type(errno_num, err_msg, err_filename)
NotADirectoryError: [Errno 20] Not a directory: 'xdg-settings'

最佳答案

来自warp-x :如果您不介意手动打开浏览器,可以在启动笔记本时传递 --no-browser:$ jupyter notebook --no-browser。然后,您可以打开浏览器,手动在浏览器(通常为 localhost:8888)中导航到笔记本并开始工作。

关于python - 每次我运行 "jupyter notebook"时,为什么我总是在 mac os 上得到这个?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/51348322/

32 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com