Spyder Icon in Ubuntu Dash Not Working

I have installed Anaconda 3 (x64 Linux) on Ubuntu 24.04 and I am running Python 3.12.4. I want to add a Spyder icon to the dash (dock). I created a spyder.desktop file in the folder ~/.local/share/applications/spyder.desktop with the following entries:

[Desktop Entry]
Type=Application
Name=Spyder
Exec=/home/yvan/anaconda3/bin/spyder
Icon=/home/yvan/Dropbox/Work/Career/Software/Images/icon_spyder.png
Terminal=false

The icon does appear in the dash. However, Spyder won’t launch if I click on it.

If I run spyder from the terminal, the app opens normally, apart from a warning message:

Warning: Ignoring XDG_SESSION_TYPE=wayland on Gnome. Use QT_QPA_PLATFORM=wayland to run on Wayland anyway.
QXcbIntegration: Cannot create platform OpenGL context, neither GLX nor EGL are enabled

I realize maybe spyder does not exist in that directory. My question is, where is spyder exec file saved in Anaconda3? What should I do to have the app on dash working?

@chicoutimy,

I experimented with this myself and found the following works:

[Desktop Entry]
Type=Application
Name=Spyder
Exec=/home/my-user/anaconda3/bin/conda run -n <env> spyder
Icon=/home/my-user/Pictures/spyder-logo.png
Terminal=false

The key difference is that I’m using conda run to launch Spyder. When you try this yourself, be sure to set the -n option to the correct environment where Spyder is installed.

Also, you can use the logs application in Ubuntu to help debug. I found this guide useful while I was debugging this:

I also wanted to add that this should be working for you automatically when you install Spyder. If you’re running into problems, you should reach out to the Spyder maintainers directly.