Using PyCharm, I have configured a virtual environment. This results in some really confusing interactions with PATH. When I look at the environment variable for PATH that a file has:
print '##### PATH'
print os.environ['PATH']
I see the following output:
##### PATH
/usr/bin:/bin:/usr/sbin:/sbin:/Users/username/.virtualenvs/venv/bin
This confuses me because I have explicitly told PyCharm to use system environment variables through the following dialog:
When clicking "Show" I see that PATH is defined differently:
What I do not understand is:
Running PyCharm from a shell using charm
results in PATH being successfully set:
##### PATH
/Users/username/.virtualenvs/username/bin:/Users/username/go/dependencies/bin:/usr/local/go/bin:/usr/local/go/bin:/usr/local/bin:.... etc
This is without any other configuration taking place in PyCharm - simply relaunching it from a shell causes PATH to behave set differently
I can also manually define the PATH variable in PyCharm (to the value given in the parent environment variables tab) and it works fine, too
But for some reason PyCharm is not pulling the PATH variable from my parent environment variables even though it is present and appears to be included properly (without either of the above two workarounds).
Why is PyCharm doing this and what do I need to do to actually "include parent environment variables" correctly?
I am using PyCharm 5.0.4 on OS:X with a bash shell.
It is a known bug in pycharm and OS X: https://youtrack.jetbrains.com/issue/PY-17816
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With