Why is PYTHONPATH empty and must be exported every terminal session?
已回答
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!
请先登录再写评论。
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