Adding path to $PATH

I'm trying to add an additional path to the PATH environment variable in my run configuration. With the default configuration os.environ.get('PATH') returns

/usr/bin:/bin:/usr/sbin:/sbin

(as expected). If I add PATH=/mypath and check 'Include parent environment variables' the above is simply replaced with /mypath, i.e. with /usr/bin etc. missing.

Setting PATH=/mypath:$PATH doesn't seem to work either, since $PATH does not get expanded and appears verbatim.

What am I doing wrong?
5
2 comments
Avatar
Permanently deleted user
I believe 'include parent env vars' only means that it passes through variables from the shell that launched PyCharm. It doesn't perform any variable expansion and you can only set literal values in that window.  So you would have to either set the complete PATH expression you want, or have it set in the shell that launched PyCharm + use 'include parent env vars', or else have the program itself modify the path.
0

What is the proper syntax to append a value to a variable in the configuration? 

I'm on windows, tried 

PATH=%PATH%;my_path   - doesn't work

 

1

Please sign in to leave a comment.