Pycharm set the correct PATH environment variable

I am doing the following with pycharm:

print(os.environ["PATH"]) # returns '/usr/bin:/bin:/usr/sbin:/sbin' 

But when I execute echo $ PATH in the shell, this returns:

 /usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/usr/bin:/bin:/usr/sbin:/sbin:/opt/local/bin:/opt/local/sbin 

I tried to edit it in Settings> Console> Python Console> Environment Variables by setting

PATH=/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/usr/bin:/bin:/usr/sbin:/sbin:/opt/local/bin:/opt/local/sbin

but it does not work

any idea?

+7
python pycharm interpreter
source share
1 answer

I work on the command line in bash, and my environment, including $PATH , is set to .bash_profile . The default terminal in PyCharm is tcsh . I changed it to bash by going to File ... Default settings ... Tools ... Terminal ... Path to the shell and then restyling. The built-in terminal worked as expected.

0
source share

All Articles