ked*_*dad 16 windows python pip
在使用pip安装Jupiter Notebook的过程中,它说脚本安装在不在PATH上的文件夹中。它会导致任何问题吗?我该如何解决?
这是完整的日志:
Installing collected packages: six, ipython-genutils, decorator, traitlets, jupyter-core, jsonschema, nbformat, tornado, pyzmq, entrypoints, pygments, MarkupSafe, jinja2, webencodings, bleach, mistune, pandocfilters, testpath, defusedxml, nbconvert, Send2Trash, wcwidth, prompt-toolkit, parso, jedi, colorama, pickleshare, backcall, ipython, python-dateutil, jupyter-client, ipykernel, pywinpty, terminado, prometheus-client, notebook
The scripts jupyter-migrate.exe, jupyter-troubleshoot.exe and jupyter.exe are installed in 'c:\users\??????\appdata\local\programs\python\python37\Scripts' which is not on PATH.
Consider adding this directory to PATH or, if you prefer to suppress this warning, use --no-warn-script-location.
The script jsonschema.exe is installed in 'c:\users\??????\appdata\local\programs\python\python37\Scripts' which is not on PATH.
Consider adding this directory to PATH or, if you prefer to suppress this warning, use --no-warn-script-location.
The script jupyter-trust.exe is installed in 'c:\users\??????\appdata\local\programs\python\python37\Scripts' which is not on PATH.
Consider adding this directory to PATH or, if you prefer to suppress this warning, use --no-warn-script-location.
The script pygmentize.exe is installed in 'c:\users\??????\appdata\local\programs\python\python37\Scripts' which is not on PATH.
Consider adding this directory to PATH or, if you prefer to suppress this warning, use --no-warn-script-location.
Running setup.py install for MarkupSafe ... done
Running setup.py install for pandocfilters ... done
The script jupyter-nbconvert.exe is installed in 'c:\users\??????\appdata\local\programs\python\python37\Scripts' which is not on PATH.
Consider adding this directory to PATH or, if you prefer to suppress this warning, use --no-warn-script-location.
Running setup.py install for backcall ... done
The scripts iptest.exe, iptest3.exe, ipython.exe and ipython3.exe are installed in 'c:\users\??????\appdata\local\programs\python\python37\Scripts' which is not on PATH.
Consider adding this directory to PATH or, if you prefer to suppress this warning, use --no-warn-script-location.
The scripts jupyter-kernel.exe, jupyter-kernelspec.exe and jupyter-run.exe are installed in 'c:\users\??????\appdata\local\programs\python\python37\Scripts' which is not on PATH.
Consider adding this directory to PATH or, if you prefer to suppress this warning, use --no-warn-script-location.
Running setup.py install for pywinpty ... done
Running setup.py install for prometheus-client ... done
The scripts jupyter-bundlerextension.exe, jupyter-nbextension.exe, jupyter-notebook.exe and jupyter-serverextension.exe are installed in 'c:\users\??????\appdata\local\programs\python\python37\Scripts' which is not on PATH.
Consider adding this directory to PATH or, if you prefer to suppress this warning, use --no-warn-script-location.
Successfully installed MarkupSafe-1.0 Send2Trash-1.5.0 backcall-0.1.0 bleach-3.0.2 colorama-0.4.0 decorator-4.3.0 defusedxml-0.5.0 entrypoints-0.2.3 ipykernel-5.1.0 ipython-7.1.1 ipython-genutils-0.2.0 jedi-0.13.1 jinja2-2.10 jsonschema-2.6.0 jupyter-client-5.2.3 jupyter-core-4.4.0 mistune-0.8.4 nbconvert-5.4.0 nbformat-4.4.0 notebook-5.7.0 pandocfilters-1.4.2 parso-0.3.1 pickleshare-0.7.5 prometheus-client-0.4.2 prompt-toolkit-2.0.7 pygments-2.2.0 python-dateutil-2.7.5 pywinpty-0.5.4 pyzmq-17.1.2 six-1.11.0 terminado-0.8.1 testpath-0.4.2 tornado-5.1.1 traitlets-4.3.2 wcwidth-0.1.7 webencodings-0.5.1
Run Code Online (Sandbox Code Playgroud)
如何修复它的答案就在您发布的日志中。
添加位置
c:\users\??????\appdata\local\programs\python\python37\Scripts
Run Code Online (Sandbox Code Playgroud)
到 Python 路径目录。
您可以按照以下答案进行操作,而不是复制说明:将目录添加到 Python 路径
这会导致任何问题吗?
如果您在未指定确切位置的情况下尝试访问该脚本,Python 将无法找到它。只有您会知道这是否真的会给您带来问题。
小智 8
对我来说,Stese 发布的解决方案不起作用,也没有任何帮助,因此我发布它是为了更新线程并帮助社区。
尽管我已经正确配置了$PYTHONPATH,但终端仍然无法找到已安装的软件包。
因此,我打开了~/.bashrc(或者~/.zshrc如果您使用的是新的zsh,可用于 mac-os Catalina 10.15.x 或更高版本)并粘贴以下内容:
export PATH="${PATH}:/Users/caio.hc.oliveira/Library/Python/3.7/bin"
export PYTHONPATH="${PYTHONPATH}:/Users/caio.hc.oliveira/Library/Python/3.7/bin"
Run Code Online (Sandbox Code Playgroud)
保存文件并重新启动终端。
重要提示:这是配置到我的 python 路径的示例。找到你的并替换。
如果仍然无法找到该包,还有另一种可能性,即将指向alias可执行文件。
因此,在同一个文件中~/.bashrc(或者如果您使用zsh它~/.zshrc),您可以在末尾附加:
alias jupyter='/Users/caio.hc.oliveira/Library/Python/3.7/bin/jupyter'
Run Code Online (Sandbox Code Playgroud)
保存并重新启动终端。
重要提示:这是配置到我的 python 路径的示例。找到你的并替换。
您可以使用它来指向任何可执行文件;)
小智 8
对于 Windows,请执行以下步骤:
转到文件资源管理器。导航到 C: ? 用户?(您的用户名) ?应用程序数据 ?当地的 ?程式 ?Python ?Python38-32(您的 Python 版本)?脚本
复制此路径,例如,
???C:\Users\(your username)\AppData\Local\Programs\Python\Python38-32\Scripts
右键单击“计算机”、“我的电脑”或“此电脑”图标 ? 选择“属性”。单击“高级系统设置”(在左侧)。(在要求时输入您的管理员密码。)在“系统属性”窗口中,单击“环境变量”(靠近底部)。在“环境变量”窗口中,PATH在“系统变量”下搜索。选择它并单击“编辑...”。将分号 (";") 添加到变量值并粘贴您在步骤 1 中复制的路径。
关闭命令提示符窗口。打开一个新的命令提示符窗口。
您现在将能够运行您想要运行的命令。
| 归档时间: |
|
| 查看次数: |
179300 次 |
| 最近记录: |