Problem with Environment variables on Ubuntu


im using Ubuntu 12.04 and want to run some files that import the QSTK library ( which needs several environment variables to be set.

If I run these files directly from the Terminal/IPython they run fine but if I try to run them from within Pycharm it always throws an "ImportError: No module named qstkutil.qsdateutil".

I dont know why Pycharm cant recognize these variables (I have to admit that I am still new to Ubuntu and i had a similar problem with Spyder too), but even when i try to add these environment variables manually to the interpreter options in Pycharm it still fails.

Any idea what I am doing wrong?

Many thanks!
Comment actions Permalink
If you've defined the environment variables in .bash_profile, PyCharm will only see them if you run it from bash (which people normally don't do). Please try defining them in /etc/environment instead.

For more information, please refer to
Comment actions Permalink


Dmitry Jemerov thanks !

in ubuntu,

environment variables defined in ~/.bashrc file won't be loaded when start IntelliJ via desktop entry (/usr/local/bin/idea).

after I moved these environment variables into ~/.profile and restart again, it works perfectly.


Please sign in to leave a comment.