I want to call an app from its bash command using Python. I added the path to the app to the PATH environment variable, so that this work in the terminal. However, when doing this in Pycharm, it does not work. I discovered, that is because apparently the environment variables are not all loaded in, when I call the app in Pycharm.
This is what I do in the terminal:
(save) philipp@philipp-Blade-15-Advanced-Model-Early-2020:~$ python
Python 3.8.2 (default, Mar 25 2020, 17:03:02)
[GCC 7.3.0] :: Anaconda, Inc. on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import os
>>> os.environ["PATH"]
'/home/philipp/anaconda3/envs/save/bin:/home/philipp/anaconda3/condabin:/home/philipp/sumo/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin'
When I run the same command in Pycharm, I get this output:
'/home/philipp/anaconda3/envs/save/bin:/home/philipp/anaconda3/condabin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin'
The output from Pycharm is missing /home/philipp/sumo/bin
which is where I installed my app and where I need to call it from. I looked into this a lot, but could not figure out what the issue would be... I am using the same Anaconda environment in both cases. Can you point out the issue?