3

I have installed Spyder Python IDE in a virtual environment. For this purpose I used the following command:

python3 -m venv spyder-env
source spyder-env/bin/activate

I have to switch to the virtual environment and then type spyder. I am using Ubuntu 20.04. Can I create a bash command as a shortcut and then create a desktop icon to directly open it in order to save time?

Zanna
  • 72,312
freak11
  • 131

1 Answers1

2

I reach to this question with a similar problem, but in my case my virtual environment was created on conda... I am sharing the solution for the desktop icon I found for conda environment (I named the environment 'spyder'), for someone else struggling with a similar problem...:

Name=Spyder5
Comment=spyder inside virtual environment
Exec=bash -i -c "conda activate spyder; python -m spyder.app.start"
Icon=/home/<username>/anaconda3/envs/spyder/share/icons/spyder.png
Type=Application
Terminal=true

Inside spyder.desktop file created as described here. The bash -i -c, and the ; mentioned by the user5357633 in the comment above directed me to the solution.

hamagust
  • 207