【问题标题】:How do I create a quick launch icon for an iPython virtual environment如何为 iPython 虚拟环境创建快速启动图标
【发布时间】: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


    【解决方案1】:

    我认为您可能正在寻找类似this 的东西。

    您可以创建一个 bash 脚本来设置您喜欢的 venv 并执行某个 Notebook。让我知道这是否适合您。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2019-03-19
      • 2021-07-30
      • 2016-04-11
      • 2014-01-24
      • 2018-06-18
      • 1970-01-01
      相关资源
      最近更新 更多