I want to launch Spyder with tensorflow environment activated directly through a desktop icon. For this purpose, I created a desktop icon launching a virtualenv and then my application. Many posts already exist but I cannot find a solution for this exact problem. Here is my spyder.sh file:
#!/bin/bash
source /home/alexis/tensorflow/bin/activate
spyder3
and here is my desktop entry:
[Desktop Entry]
Version=1.0
Name=Spyder
Comment=Spyder
Exec='/home/alexis/Launcher/spyder.sh'
Icon=spyder3
Terminal=true
Type=Application
Categories=Application;
Name[en_US]=Spyder
The files have chmod +x
. From a terminal, the script works as expected. From the desktop, the script launches Spyder but the environment is not activated. What I am missing?
Related questions not answering my question: How do I make a desktop icon to launch a program? and How do I automate the activation of Python environment