Operating System: Ubuntu 16.04 64-bit Python 3.6 installed via apt-get
When compiling a program in the terminal using:
python3.6 programa.py
No error is displayed.
When running the same program with the python or Wing Python IDE, with python3.6, I get errors from libraries (eg numpy, pycuda) not found.
The executed code:
#https://documen.tician.de/pycuda/tutorial.html
import pycuda.driver as cuda
import pycuda.autoinit
from pycuda.compiler import SourceModule
import numpy
a = numpy.random.randn(4,4)
a = a.astype(numpy.float32)
a_gpu = cuda.mem_alloc(a.nbytes)
cuda.memcpy_htod(a_gpu, a)
mod = SourceModule("""
__global__ void doublify(float *a)
{
int idx = threadIdx.x + threadIdx.y*4;
a[idx] *= 2;
}
""")
Error (IDE only, running from the terminal there is no error):
pytools.prefork.ExecError: error invoking 'nvcc --version': [Errno 2] No such file or directory: 'nvcc'
Doubt: how to do for the IDEs used the same installation of python3.6 that works when calling in the finish? How do I find out which is installed with all the libraries installed?
PS: I discovered the problem. I just do not know how to solve it. Python IDEs are not seeing the environment variables and I do not know how to set them!