I realize my problem is with a specific app but I do not have, or have not noticed, this problem when using VSCodium on other distributions in the past, or while using the VSC snap package in an Ubuntu VM. So I apologize for posting here but this configuration seems to me to be specific to the Fedora/Flatpak package of VSCodium. I thought maybe another more experienced VSCodium user might be able to help me with this. I’m just a regular guy learning to code with Python in my spare time so please forgive my inexperience.
I discovered this problem when I tried to run a Python program I wrote in VSC’s integrated terminal. I get hit with an error that the module I’m trying to import (pygame) is not installed, even though I know the module is installed. Running
pip show pygame in Gnome Terminal confirms this. That’s when I noticed that the prompt in VSC’s integrated terminal is different to the regular Gnome Terminal.
In VSC the prompt shows as
sh-5.1$, while the Terminal app has my familiar
[dennis@fedora ~]$. Checking the version of bash and python in both confirms that I’m working with two different environments here. Using pip to install the module within VSC’s terminal does “fix” the problem, but I find it very redundant to install the same module twice!
I’ve poked around VSC’s settings looking for terminal, shell, environment options; I’ve turned a few things on and off but I can’t find the fix.
VSCodium version: 220.127.116.1174
Bash/Python versions in VSCodium:
sh-5.1$ bash --version GNU bash, version 5.1.16(1)-release (x86_64-unknown-linux-gnu) Copyright (C) 2020 Free Software Foundation, Inc. License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html> This is free software; you are free to change and redistribute it. There is NO WARRANTY, to the extent permitted by law. sh-5.1$ python --version Python 3.10.6
Bash/Python version according to Gnome Terminal:
[dennis@fedora ~]$ bash --version GNU bash, version 5.2.15(1)-release (x86_64-redhat-linux-gnu) Copyright (C) 2022 Free Software Foundation, Inc. License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html> This is free software; you are free to change and redistribute it. There is NO WARRANTY, to the extent permitted by law. [dennis@fedora ~]$ python --version Python 3.11.2 [dennis@fedora ~]$ which python /usr/bin/python
I tried to explicitly set the interpreter, but the version I want, accessible from any other terminal, does not show up on the list:
You can see the selected interpreter is
/usr/bin/python, which is the same path from the
which python command above.
I’m at a loss here. I’m not sure how this is even possible. I can’t even import tkinter with whatever interpreter VSCodium is using, even though that’s a standard library module.
I’ve also tried right-clicking the file in the explorer and selecting “run in external terminal”. According the my settings, this should open Gnome Terminal, but it does nothing instead. Is this a side-effect of VSC being installed with a flatpak?