Could not build wheels for pycuda
Asked Answered
P

4

6

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
Pucker answered 21/7, 2022 at 13:40 Comment(2)
edit and show the full text of the error message, please.Tarkington
Please provide enough code so others can better understand or reproduce the problem.Lucero
M
5

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
Mohandas answered 4/5, 2023 at 5:32 Comment(1)
any solution for windows 11?Reserved
P
2

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
Pucker answered 21/7, 2022 at 13:42 Comment(0)
J
0

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

Many thanks to @user19594699

John answered 27/3 at 12:52 Comment(0)
V
0

Scroll up to see the output of the subprocess where the error originated. And make sure you have enough space in your root partition (that has been the cause too many times for me!)

Vladamar answered 6/9 at 19:9 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.