I created Python virtual environments using conda. Following conda user guide, I added an environment variable in ./etc/conda/activate.d/env_vars.sh
:
export PYTHONPATH="~/codes/my_modules:$PYTHONPATH"
This allows to import personal modules I saved in ~/codes/my_modules/
and it works fine when I run scripts in the Terminal.
However, if I run my scripts in PyCharm inside the Python Console, it seems that these environment variables are not "loaded" while I configured the correct Python interpreter.
Is there a solution for PyCharm to "load" what is in ./etc/conda/activate.d/env_vars.sh
?
Note: I'd prefer not to configure the environment variables manually in the configuration window of PyCharm. This can be done by following the solution given here, but I'd prefer if PyCharm could check what's in ./etc/conda/activate.d/env_vars.sh
automatically.
Many thanks for your help.