Windows下已安装Jupyter及Notebook却提示'jupyter-notebook'命令未找到求助
解决Windows 10下Jupyter Notebook命令找不到及IntelliJ无法运行.ipynb的问题
针对你遇到的python -m jupyter notebook报错“Jupyter command 'jupyter-notebook' not found”、IntelliJ无法运行.ipynb文件的问题,可尝试以下排查和解决步骤:
检查Python Scripts目录的PATH配置
Jupyter Notebook的可执行文件(jupyter-notebook.exe)实际存放在Python的Scripts目录中,而非site-packages。你需要将对应路径添加到系统PATH:
路径示例:C:\Users\<你的用户名>\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.10_qbz5n2kfra8p0\LocalCache\local-packages\Python310\Scripts
添加后重启终端和IntelliJ,执行where jupyter-notebook验证是否能找到可执行文件。强制重装并重建启动脚本
执行以下命令彻底卸载并重新安装相关包,确保生成正确的启动脚本:pip uninstall -y jupyter jupyter-notebook jupyter-core pip install --force-reinstall jupyter notebook校正IntelliJ的解释器和Jupyter配置
- 打开
File > Project Structure > Project Interpreter,确认选中的是Python 3.10.11的全局解释器,检查已安装包列表中是否存在notebook,若缺失则手动搜索安装。 - 进入
File > Settings > Tools > Jupyter,确认选择的解释器与上述一致,并勾选“Use configured interpreter”。
- 打开
绕开jupyter命令直接启动notebook模块
如果python -m jupyter notebook仍失效,尝试直接调用notebook核心模块:python -m notebook使用Python绝对路径执行命令
若PATH配置仍有问题,直接使用Python解释器的绝对路径运行:"C:\Users\<你的用户名>\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.10_qbz5n2kfra8p0\LocalCache\local-packages\Python310\python.exe" -m notebook
内容的提问来源于stack exchange,提问作者JupitersClouds
相关产品推荐
相关产品推荐

