PyCharm remote interpreter [Errno 2] No such file or directory: nvcc

I have set up a remote interpreter in PyCharm on a VM. Have set the correct interpreter with all libraries installed. However, when I execute the program (which includes a part in C) within PyCharm I get the following error: [Errno 2] No such file or directory: 'nvcc': 'nvcc'

However, when I execute the program on the VM through shell all works fine.

I assume this has to do with some path mapping but I don't know how to fix it.

When exec. in PyCharm I have the following on

`'PATH': ['/usr/local/bin', '/usr/bin', '/bin', '/usr/games']`

On VM I also have cuda in the path:

`'PATH': ['/usr/local/cuda/bin', '/home/<user>/anaconda3/envs/deep-drr/bin', '/usr/local/cuda/bin','/usr/local/bin', '/usr/bin', '/bin', '/usr/local/games', '/usr/games']`

How do I add that extra path to cuda to the PyCharm remote interpreter? Thanks in advance!

EDIT: I've already tried to add /usr/local/cuda/bin to Interpreter path as described here




Comment actions Permalink


So does 'nvcc' located in /usr/local/cuda/bin ?

Please try the following:

1. In VM terminal copy the value of your PATH variable which includes all the necessary paths

2. In PyCharm, open run/debug configuration and set the PATH env variable with the value you copied. This should overwrite the PATH variable when you execute the script.

Comment actions Permalink

thanks for getting back Andrey!

yes, nvcc is located in /usr/bin/cuda/bin

which field do you exactly mean by your 2. point? on the Run/Debug Configurations window, do you mean the Path mappings field as in the attached screenshot?

Also, in the above case. which local path should I map the remote nvcc to as I don't have it installed locally?









Comment actions Permalink

What I mean is:

1. In the terminal where everything is working, do `echo $PATH` and copy the string somewhere.

2. In PyCharm, open run/debug configuration, open Environment variables, and add PATH variable with the value you just copied.

Comment actions Permalink

Hi Andrey,

thanks for you help. What I was looking for was the option to set variables when clicking the $ next to environment variables. just pasting wasn't persistent - I don't know why. 

However, it works perfectly now.






Please sign in to leave a comment.