Python3.10已装Jupyter,但终端无法定位jupyter可执行文件
macOS下Jupyter可通过
python3 -m启动但which jupyter找不到的问题 在macOS系统上安装Python 3.10后,执行python3 -m jupyter notebook可以正常启动Jupyter Notebook,但执行which jupyter时提示“jupyter not found”。该问题还导致无法执行IRkernel::installspec()安装R内核,具体报错见下文。
环境与配置信息
- 已安装的Jupyter相关包(执行
pip list | grep jupyter输出):jupyter 1.0.0 jupyter_client 8.2.0 jupyter-console 6.6.3 jupyter_core 5.3.0 jupyter-events 0.7.0 jupyter-lsp 2.2.0 jupyter_server 2.7.3 jupyter_server_terminals 0.4.4 jupyterlab 4.0.6 jupyterlab-pygments 0.2.2 jupyterlab_server 2.25.0 jupyterlab-widgets 3.0.9 - Python安装路径:
/Library/Frameworks/Python.framework/Versions/3.10 - bash配置文件内容:
PYTHONPATH="/Library/Frameworks/Python.framework/Versions/3.10/bin/python3" export PATH="/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/site-packages:$PATH" export PATH="/Library/Frameworks/Python.framework/Versions/3.10/bin:$PATH" export PYTHONPATH - 系统PATH环境变量(执行
echo $PATH输出):/opt/homebrew/bin:/opt/homebrew/sbin:/Library/Frameworks/Python.framework/Versions/3.10/bin:/usr/local/bin:/System/Cryptexes/App/usr/bin:/usr/bin:/bin:/usr/sbin:/sbin:/opt/X11/bin:/var/run/com.apple.security.cryptexd/codex.system/bootstrap/usr/local/bin:/var/run/com.apple.security.cryptexd/codex.system/bootstrap/usr/bin:/var/run/com.apple.security.cryptexd/codex.system/bootstrap/usr/appleinternal/bin
错误信息
执行IRkernel::installspec()安装R内核时,出现以下错误:
Error in IRkernel::installspec() : jupyter-client has to be installed but “jupyter kernelspec --version” exited with code 127.
疑问
为何通过python3 -m jupyter notebook能正常启动Jupyter,但which jupyter却无法定位到可执行文件?是否是PATH或环境配置存在问题?已尝试过现有类似问题的解决方案,但均无效。
内容的提问来源于stack exchange,提问作者corvusMidnight
相关产品推荐
相关产品推荐

