【发布时间】:2021-01-28 21:58:35
【问题描述】:
在 Anaconda 中,我创建了一个虚拟环境,并通过在 anaconda 提示符中依次运行这些行来为其创建内核:
conda create --name my_venv python=3.7
conda activate my_venv
conda install -c anaconda ipykernel
python -m ipykernel install --user --name=my_venv
但要启动它,我必须在 anaconda 提示符下激活它并运行:
jupyter notebook
我希望能够从我的 (Windows) 桌面快速启动 venv,其图标类似于您在为基本环境安装 Anaconda 时获得的图标 - 下方的破橙色圆圈图标:
我已经尝试了this article 中的说明,但生成的快捷方式没有任何作用,它只是短暂地闪烁一个看起来像 CMD 提示符的窗口,然后没有任何反应。
(TLDR,文章说要复制base env图标,右键点击进入属性,然后将目标框中的文本从这里更改:
E:\Python\python.exe E:\Python\cwp.py E:\Python E:\Python\python.exe
E:\Python\Scripts\jupyter-notebook-script.py
对此 - 对于一个名为 tensorflow_gpu 的 venv)
E:\Python\envs\tensorflow_gpu\python.exe E:\Python\cwp.py
E:\Python\envs\tensorflow_gpu E:\Python\envs\tensorflow_gpu\python.exe
E:\Python\envs\tensorflow_gpu\Scripts\jupyter-notebook-script.py
部分问题可能是我的 venv 在其脚本文件夹中没有名为 jupyter-notebook-script.py 的文件。 Scripts的内容是:
2to3.exe、2to3-script.py、easy_install.exe、easy_install-script.py、idle.exe、idle-script.py、iptest.exe、iptest3.exe、iptest3-script.py、iptest-script .py、ipython.exe、ipython3.exe、ipython3-script.py、ipython-script.py、jupyter.exe、jupyter-kernel.exe、jupyter-kernel-script.py、jupyter-kernelspec.exe、jupyter-kernelspec -script.py、jupyter-migrate.exe、jupyter-migrate-script.py、jupyter-run.exe、jupyter-run-script.py、jupyter-script.py、jupyter-troubleshoot.exe、jupyter-troubleshoot-script .py、pip.exe、pip3.exe、pip3-script.py、pip-script.py、pydoc.exe、pydoc-script.py、pygmentize.exe、pygmentize-script.py、pywin32_postinstall.py、pywin32_testall.py 、wheel.exe、wheel-script.py。
如何制作这个快速启动图标?
【问题讨论】:
标签: python jupyter-notebook anaconda jupyter python-venv