PYCUDA Installation


I am facing errors in installing and using PYCUDA for my project.

Below are my environment details-

CUDA - V9.0.176
CUDNN - v7.3.1.20
TensorRT - 5.1
Python - 2.7 and 3.6

All the above software are already installed.
I am following below link to install PYCUDA -

while following the steps on this link, I was facing problems in step 2 of the installation process. After making some fixes and escaping step 2 , we directly ran step 3.
The “make” file ran successfully and it looked like PYCUDA is installed. But when we import pycuda with below command-
import pycuda.autoinit
it throws below error-

import pycuda.autoinit
Traceback (most recent call last):
File “”, line 1, in
File “pycuda/”, line 2, in
import pycuda.driver as cuda
File “pycuda/”, line 5, in
from pycuda._driver import * # noqa
ImportError: No module named _driver

Please have a look and suggest.



I understand that this doesn’t answer your question but may I know if there’s any specific reason you’re not using pip or conda to install pycuda?

Please try this:

If you try to import any of the pycuda files while you are in the directory that you extracted the pycuda tar.gz file then, it will fail with the above error.

Try running the python shell in another directory and then importing pycuda.