Why is PYTHONPATH empty and must be exported every terminal session?
Answered
Hi đ
Using Mac OS - Big Sur, I have a PyCharm project that holds two source roots directories.
Whenever I try to:
echo $PYTHONPATH
It results empty and I must export it locally per session.
I am using zsh as my shell and in the PyCharm Settings > Pythob Console I have both of these checked:Â

I really don't understand what is wrong and why the above does not add the source root's path to the PYTHONPATH automatically.
Thanks!
Please sign in to leave a comment.
Hi,
The directories marked as source roots are added to PYTHONPATH at runtime. It doesn't affect the terminal.Â
For the terminal, you can modify environment variables in **Preferences | Tools | Terminal**.
Great!
Worked as I want it.
Thanks a lot Andrey Resler