Getting PyCharm To Use the $PATH variable

Answered

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
     /usr/local/cuda-7.0/bin/nvcc

So, it looks as though PyCharm should be able to find nvcc. Furthermore, following the advice from a similar question (https://intellij-support.jetbrains.com/hc/en-us/community/posts/206597555-PyCharm-Virtualenv-and-Environment-variables?sort_by=votes) , 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
     /usr/local/cuda-7.0/bin:/usr/local/include:/usr/local/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games

 

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/data_manager_cifar100.py

(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.

 

 

2 comments
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.

0
Comment actions Permalink

Hi,

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

0

Please sign in to leave a comment.