PyCharm different Environment when starting Terminal vs. Starter?

i am using Pycharm with LInux Mint - when ich start the program directly from the Terminal with ./ everything seems to be fine with the interpreter - all the modules are installed and available:

But when i start the exact sh-file with a starter from the desktiop i cant see the modules anymore in the interpreter:

How can this be?
Only the call of the program is different...?

Comment actions Permalink

Hi, this is likely due to different environments in your terminal vs desktop session. How did you install this interpreter? 

Try doing `~/GitHub/bin/python -m pip list` from your terminal, what is the output? 

Compare PATH and PYTHONPATH variables after starting PyCharm from both places - are there differences? 

Comment actions Permalink


i think i haven`t installed anything regarding the python interpreter - python 3.6. should be allready installed in the linux mint distribution i think.
Pycharm itself was installed with this instruction:

This is the output of the list statement:
rapid1898@rapid1898-B85-HD3:~$ ~/GitHub/bin/python -m pip list
Package Version
-------------- ----------
beautifulsoup4 4.9.1
bs4 0.0.1
certifi 2020.4.5.2
chardet 3.0.4
get 2019.4.13
idna 2.9
pip 20.1.1
post 2019.4.13
public 2019.4.13
pygame 1.9.6
query-string 2019.4.13
request 2019.4.13
requests 2.23.0
setuptools 47.1.1
soupsieve 2.0.1
urllib3 1.25.9

Starting from both places - <Settings> - <Appearance & Behavior> - <Path Variable> are completely empty.




Comment actions Permalink

How did you create the desktop shortcut? Did you do it from PyCharm? (Tools | Create desktop entry)

Please start PyCharm from desktop, open terminal and do `which python` - should point to "~/GitHub/bin/python"

Then `which pip` - where does it point to?

Also `echo $PATH` - please provide the output.

Comment actions Permalink

I created the shortcut directly on the desktop with right mouseclick on it and selected starter - there i choose the (the same which i start from the terminal).

These are the informations (PyCharm from desktop):
(but this are exactly the same informations as when ich open PyCharm from the terminal - the only difference you can see in the link above regarding the modules...)

(GitHub) rapid1898@rapid1898-B85-HD3:~/Dokumente/GitHub$ which python

(GitHub) rapid1898@rapid1898-B85-HD3:~/Dokumente/GitHub$ which pip

(GitHub) rapid1898@rapid1898-B85-HD3:~/Dokumente/GitHub$ echo $PATH | tr ":" "\n" | nl
1 /home/rapid1898/GitHub/bin
2 /home/rapid1898/.local/bin
3 /home/rapid1898/bin
4 /usr/local/sbin
5 /usr/local/bin
6 /usr/sbin
7 /usr/bin
8 /sbin
9 /bin
10 /usr/games
11 /usr/local/games
12 /snap/bin

Comment actions Permalink

Could you try creating a desktop entry from the Tool menu? 

If this doesn't help, try to recreate the interpreter using absolute path (i.e. no ~ in the path)

Comment actions Permalink

Tried creating a new desktop entry - but the same problem

But then i recreated the python interpreter and choosed under existing environment the python3.6 program under /usr/bin/python3.6
And that was it!
Now it shows me with the project interpreter "Python 3.6. /usr/bin/python3.6" all the installed modules - no matter i start pycharm from desktop or terminal

Thank you very much for your help!

May I can bother yoiu with an addtional question?
There is only one problem left with the modules in PyCharm - and it is about Selenium

When i start a program with selenium i got this error.
os.path.basename(self.path), self.start_error_message)
selenium.common.exceptions.WebDriverException: Message: 'chromedriver' executable needs to be in PATH. Please see

So i tried to add this path - where the chromedriver.exe is located:

But i stil get this error...






Comment actions Permalink

You should modify env variable in run/debug configuration instead:

And make sure it's $PATH:<new_path>, otherwise you will overwrite your current path instead of appending.

Comment actions Permalink

Tried to change this in the window Run/Debug Configurations like this:

But also with this setting i get the same error message regarding chromedriver...




Comment actions Permalink

Sorry, but you do it wrong - the name of the variable should be PATH and the value should be $PATH:<new_path_you_want_to_add>

Also your path contains spaces which I strongly advice against. Good practice in programming is to not have spaces in your paths.

Comment actions Permalink

Thank you very much - now it is working


Please sign in to leave a comment.