我安装了 Jupyter Notebook,它报告满足要求,但当我尝试运行时,它报告“jupyter”未被识别为内部或外部命令。
我猜我缺少路径定义,但找不到 jupyter.exe。
我在 stackoverflow 上看到其他帖子说按照安装说明设置 python 库路径,但我搜索了 jupyter 安装并没有找到对此的引用。
有什么建议吗?
顺便说一句,Python 完全新手。
c:\Users\john_\Documents>python -m pip install jupyter
Requirement already satisfied: jupyter in c:\users\john_\appdata\roaming\python\python36\site-packages
Requirement already satisfied: qtconsole in c:\users\john_\appdata\roaming\python\python36\site-packages (from jupyter)
Requirement already satisfied: notebook in c:\users\john_\appdata\roaming\python\python36\site-packages (from jupyter)
Requirement already satisfied: nbconvert in c:\users\john_\appdata\roaming\python\python36\site-packages (from jupyter)
Requirement already satisfied: ipykernel in c:\users\john_\appdata\roaming\python\python36\site-packages (from jupyter)
Requirement already satisfied: jupyter-console in c:\users\john_\appdata\roaming\python\python36\site-packages (from jupyter)
Requirement already satisfied: ipywidgets in c:\users\john_\appdata\roaming\python\python36\site-packages (from jupyter)
Requirement already satisfied: jupyter-client>=4.1 in c:\users\john_\appdata\roaming\python\python36\site-packages (from qtconsole->jupyter)
Requirement already satisfied: ipython-genutils in c:\users\john_\appdata\roaming\python\python36\site-packages (from qtconsole->jupyter)
Requirement already satisfied: jupyter-core in c:\users\john_\appdata\roaming\python\python36\site-packages (from qtconsole->jupyter)
Requirement already satisfied: traitlets in c:\users\john_\appdata\roaming\python\python36\site-packages (from qtconsole->jupyter)
Requirement already satisfied: pygments in c:\users\john_\appdata\roaming\python\python36\site-packages (from qtconsole->jupyter)
Requirement already satisfied: nbformat in c:\users\john_\appdata\roaming\python\python36\site-packages (from notebook->jupyter)
Requirement already satisfied: jinja2 in c:\users\john_\appdata\roaming\python\python36\site-packages (from notebook->jupyter)
Requirement already satisfied: tornado>=4 in c:\users\john_\appdata\roaming\python\python36\site-packages (from notebook->jupyter)
Requirement already satisfied: pandocfilters>=1.4.1 in c:\users\john_\appdata\roaming\python\python36\site-packages (from nbconvert->jupyter)
Requirement already satisfied: entrypoints>=0.2.2 in c:\users\john_\appdata\roaming\python\python36\site-packages (from nbconvert->jupyter)
Requirement already satisfied: bleach in c:\program files (x86)\microsoft visual studio\shared\python36_64\lib\site-packages (from nbconvert->jupyter)
Requirement already satisfied: mistune>=0.7.4 in c:\users\john_\appdata\roaming\python\python36\site-packages (from nbconvert->jupyter)
Requirement already satisfied: testpath in c:\users\john_\appdata\roaming\python\python36\site-packages (from nbconvert->jupyter)
Requirement already satisfied: ipython>=4.0.0 in c:\users\john_\appdata\roaming\python\python36\site-packages (from ipykernel->jupyter)
Requirement already satisfied: prompt-toolkit<2.0.0,>=1.0.0 in c:\users\john_\appdata\roaming\python\python36\site-packages (from jupyter-console->jupyter)
Requirement already satisfied: widgetsnbextension~=3.0.0 in c:\users\john_\appdata\roaming\python\python36\site-packages (from ipywidgets->jupyter)
Requirement already satisfied: python-dateutil>=2.1 in c:\users\john_\appdata\roaming\python\python36\site-packages (from jupyter-client>=4.1->qtconsole->jupyter)
Requirement already satisfied: pyzmq>=13 in c:\users\john_\appdata\roaming\python\python36\site-packages (from jupyter-client>=4.1->qtconsole->jupyter)
Requirement already satisfied: decorator in c:\users\john_\appdata\roaming\python\python36\site-packages (from traitlets->qtconsole->jupyter)
Requirement already satisfied: six in c:\program files (x86)\microsoft visual studio\shared\python36_64\lib\site-packages (from traitlets->qtconsole->jupyter)
Requirement already satisfied: jsonschema!=2.5.0,>=2.4 in c:\users\john_\appdata\roaming\python\python36\site-packages (from nbformat->notebook->jupyter)
Requirement already satisfied: MarkupSafe>=0.23 in c:\users\john_\appdata\roaming\python\python36\site-packages (from jinja2->notebook->jupyter)
Requirement already satisfied: html5lib!=0.9999,!=0.99999,<0.99999999,>=0.999 in c:\program files (x86)\microsoft visual studio\shared\python36_64\lib\site-packages (from bleach->nbconvert->jupyter)
Requirement already satisfied: simplegeneric>0.8 in c:\users\john_\appdata\roaming\python\python36\site-packages (from ipython>=4.0.0->ipykernel->jupyter)
Requirement already satisfied: setuptools>=18.5 in c:\program files (x86)\microsoft visual studio\shared\python36_64\lib\site-packages (from ipython>=4.0.0->ipykernel->jupyter)
Requirement already satisfied: jedi>=0.10 in c:\users\john_\appdata\roaming\python\python36\site-packages (from ipython>=4.0.0->ipykernel->jupyter)
Requirement already satisfied: colorama; sys_platform == "win32" in c:\users\john_\appdata\roaming\python\python36\site-packages (from ipython>=4.0.0->ipykernel->jupyter)
Requirement already satisfied: pickleshare in c:\users\john_\appdata\roaming\python\python36\site-packages (from ipython>=4.0.0->ipykernel->jupyter)
Requirement already satisfied: wcwidth in c:\users\john_\appdata\roaming\python\python36\site-packages (from prompt-toolkit<2.0.0,>=1.0.0->jupyter-console->jupyter)
Requirement already satisfied: parso==0.1.0 in c:\users\john_\appdata\roaming\python\python36\site-packages (from jedi>=0.10->ipython>=4.0.0->ipykernel->jupyter)
这是我尝试运行 jupyter 时的错误
c:\Users\john_\Documents>jupyter notebook
'jupyter' is not recognized as an internal or external command,
operable program or batch file.
这里我显示python已安装并且可以运行
c:\Users\john_\Documents>python
Python 3.6.3 (v3.6.3:2c5fed8, Oct 3 2017, 18:11:49) [MSC v.1900 64 bit (AMD64)] on win32
Type "help", "copyright", "credits" or "license" for more information.
>>>
检查python安装文件夹下的scripts文件夹中是否有名为jupyter的exe文件。如果是,则将脚本文件夹添加到路径中。 我建议你使用 python 的 anaconda 发行版。它会照顾一切。
今天,我也遇到了同样的错误:The term 'jupyter' is not recognize as the name of cmdlet, function, script file, or operable program,”所以经过一个巨大的过程,我成功解决了这个问题,并且现在它可以在我的系统中识别了,这是我解决这个问题的方法:
为了解决这个问题,我将引导您完成两种可能首先适合您的方法,但如果它不起作用,那么您可以检查第二种方法,它帮助我解决了我的问题。
第 1 步:验证 Jupyter 安装
pip list
在已安装的软件包列表中查找
jupyter
。如果没有安装,您可以使用以下命令安装:
pip install jupyter
第 2 步:找到 Jupyter 可执行文件 如果已安装 Jupyter 但您仍然遇到错误,则意味着
jupyter.exe
可执行文件丢失或不在您的 PATH 中。
方法一:本地Python安装
导航到Python脚本目录:转到Python的安装目录。例如:
C:\Users\YourUsername\AppData\Local\Programs\Python\PythonXX\Scripts
将 XX 替换为您的 Python 版本。
检查
jupyter.exe
:确保 jupyter.exe
存在于
脚本目录。
添加到路径:
env
,然后选择 Edit the system environment variables
。Environment Variables
按钮。Path
部分找到 System variables
变量,然后单击 Edit
。C:\Users\YourUsername\AppData\Local\Programs\Python\PythonXX\Scripts
验证 Jupyter 命令:打开新终端并运行:
jupyter --version
方法2:漫游Python安装 如果您的 Python 安装在 Roaming 目录中,请按照以下步骤操作:
导航到 Python 脚本目录:转到安装 Python 的目录。例如:
C:\Users\YourUsername\AppData\Roaming\Python\Python312\Scripts
检查
jupyter.exe
:确保 jupyter.exe
存在于脚本目录中。
添加到路径:
env
,然后选择 Edit the system environment variables
。Environment Variables
按钮。Path
部分找到 System variables
变量,然后单击 Edit
。C:\Users\YourUsername\AppData\Local\Programs\Python\PythonXX\Scripts
验证 Jupyter 命令:打开新终端并运行:
jupyter --version
按照以下步骤操作,您应该能够解决问题并成功使用 Jupyter 命令。