我总是在添加路径时苦苦挣扎。
安装jupyter笔记本后,它会发出警告
The scripts jupyter, jupyter-migrate and jupyter-troubleshoot are installed in '/Users/gangzhao/Library/Python/3.7/bin' 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, jupyter-kernelspec and jupyter-run are installed in '/Users/gangzhao/Library/Python/3.7/bin' 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 is installed in '/Users/gangzhao/Library/Python/3.7/bin' 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 is installed in '/Users/gangzhao/Library/Python/3.7/bin' 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 is installed in '/Users/gangzhao/Library/Python/3.7/bin' 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-nbconvert is installed in '/Users/gangzhao/Library/Python/3.7/bin' 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 iptest, iptest3, ipython and ipython3 are installed in '/Users/gangzhao/Library/Python/3.7/bin' 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-bundlerextension, jupyter-nbextension, jupyter-notebook and jupyter-serverextension are installed in '/Users/gangzhao/Library/Python/3.7/bin' 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-console is installed in '/Users/gangzhao/Library/Python/3.7/bin' which is not on PATH.
Consider adding this directory to PATH or, if you prefer to suppress this warning, use --no-warn-script-location.我发现了一个关于添加目录到PYTHONPATH的真正的good post。
但我还是想不通。
export PYTHONPATH="${PYTHONPATH}:/my/other/path"我搞不清什么是PYTHONPATH,什么是/my/other/path
发布于 2020-06-29 08:31:17
也许你应该试试在安装Anaconda时使用内置的jupyter笔记本。当我通过Anaconda安装Jupyter时,从来没有遇到过这样的问题。
发布于 2021-10-17 16:00:02
不知道你是否已经修复了这个问题,但我最近在树莓派的零W上构建jupyter时也重现了同样的错误,所以我想我发布了一个解决方案。
我的连接是通过putty的ssh
首先,我通过pip3正常安装了jupyter,并且在垃圾桶上也收到了多个路径错误。已确认这一点,因为运行任何jupyter命令都会返回not found。
我的解决方案是只做一个服务,你可以通过首先找到jupyter二进制文件的位置来实现:which jupyter-lab。这应该返回二进制文件的路径,并且应该非常类似于:/home/pi/.local/bin/jupyter-lab。记录此信息,因为在/etc/systemd/system/中创建文件时需要此信息
创建服务:
sudo nano /etc/systemd/system/jupyter.service使用以下内容填充文件:
[Unit]
Description=Jupyter Lab
[Service]
Type=simple
PIDFile=/run/jupyter.pid
ExecStart=/bin/bash -c "/home/pi/.local/bin/jupyter-lab --ip="0.0.0.0" --no-browser --notebook-dir=/home/pi/notebooks"
User=pi
Group=pi
WorkingDirectory=/home/pi/notebooks
Restart=always
RestartSec=10
[Install]
WantedBy=multi-user.target请注意,ExecStart=是您放置先前找到的二进制文件的路径的位置。这也是配置jupyter-lab的参数的地方,包括IP和notebook directory。需要注意的是,我已经为此设置了我的目录。
接下来,我们可以轻松地运行此服务:
sudo systemctl start jupyter.service或者停止它:
sudo systemctl stop jupyter.service我想让服务在每次启动时启动:
sudo systemctl enable jupyter.service
sudo systemctl daemon-reload检查服务状态:
sudo systemctl status jupyter.service这将为您提供有关从jupyter运行的ServerApp的有用服务信息。此处还将显示用于连接到您的笔记本的令牌和URL。
希望这对解决任何问题有帮助!
https://stackoverflow.com/questions/62628411
复制相似问题