Getting PyCharm To Use the $PATH variable


I'm new to PyCharm, so hope I haven't missed anything obvious, but I just started running some Python code, which uses Theano, and I got the following error:


     ERROR (theano.sandbox.cuda): nvcc compiler not found on $PATH. Check your nvcc installation and try again.


I don't understand why I get this error. When I use PyCharm's terminal to look for nvcc, I see

     me@ARL--M6800:~/Projects/keras-latent$ which nvcc

So, it looks as though PyCharm should be able to find nvcc. Furthermore, following the advice from a similar question ( , I explicitly added my PATH variable to PyCharm's environment (Settings->Build, Execution & Deployment -> Console -> Python Console).

From within the PyCharm terminal, I see the correct path:

     me@ARL--M6800:~/Projects/keras-latent$ echo $PATH


But, when I include the line

     print os.environ['PATH'}

in the code I'm trying to run, I see this in the run window:

     /usr/bin/python2.7 /home/me/Projects/keras-latent/

(i.e. path to my interpreter and the file I'm executing). I expect that this is the source of my problem, but don't really know what to do. Any ideas would be very much appreciated.



Comment actions Permalink

Hi Steven, sorry for the late reply. Is the problem still relevant for you now? What Pycharm version do you use? Do you have the same error when running the code in Terminal? Thank you.

Comment actions Permalink


I'm having the same error with Pycharm Comunity Edition 2017.2. The error appears only when running the code in Pycharm. Thanks!


Please sign in to leave a comment.