Could not build wheels for pycuda

11.3k Views Asked by At

Receiving an error during pip pycuda installation on ubuntu as follows:

command '/usr/bin/x86_64-linux-gnu-gcc' failed with exit code 1
note: This error originates from a subprocess, and is likely not a problem with pip.
  ERROR: Failed building wheel for pycuda
Failed to build pycuda
ERROR: Could not build wheels for pycuda, which is required to install pyproject.toml-based projects
3

There are 3 best solutions below

0
user19594699 On

I solved the problem by doing:

For Python 2.x use:

sudo apt-get install python-dev

For Python 2.7 use:

sudo apt-get install libffi-dev

For Python 3.x use:

sudo apt-get install python3-dev

or for a specific version of Python 3, replace x with the minor version in

sudo apt-get install python3.x-dev
1
Nawin K Sharma On

For me this worked:

export CPATH=$CPATH:/usr/local/cuda-11.8/targets/x86_64-linux/include
export LIBRARY_PATH=$LIBRARY_PATH:/usr/local/cuda-11.8/targets/x86_64-linux/lib
pip install pycuda
0
Volkov Maxim On

sudo apt-get install python3.x-dev also works for pycuda fatal error: pyconfig.h case.

Many thanks to @user19594699