pyconfig.h pip安装PyCuda时没有这样的文件或目录

时间:2019-02-01 19:31:19

标签: linux python-3.x pycuda

我正在尝试在ubuntu linux上使用python3安装PyCuda,并且在运行pip install pycuda时遇到以下错误

...
x86_64-linux-gnu-gcc -pthread -fwrapv -Wall -O3 -DNDEBUG -g -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -fPIC -DBOOST_THREAD_DONT_USE_CHRONO=1 -DPYGPU_PACKAGE=pycuda -DBOOST_MULTI_INDEX_DISABLE_SERIALIZATION=1 -Dboost=pycudaboost -DHAVE_CURAND=1 -DPYGPU_PYCUDA=1 -DBOOST_THREAD_BUILD_DLL=1 -DBOOST_ALL_NO_LIB=1 -DBOOST_PYTHON_SOURCE=1 -Isrc/cpp -Ibpl-subset/bpl_subset -I/usr/local/cuda/include -I/home/pdaly/.envs/spg/lib/python3.5/site-packages/numpy/core/include -I/home/pdaly/.envs/spg/lib/python3.5/site-packages/numpy/core/include -I/usr/include/python3.5m -I/home/pdaly/.envs/spg/include/python3.5m -c src/cpp/cuda.cpp -o build/temp.linux-x86_64-3.5/src/cpp/cuda.o
In file included from bpl-subset/bpl_subset/boost/python/detail/prefix.hpp:13:0,
                 from bpl-subset/bpl_subset/boost/python/args.hpp:8,
                 from bpl-subset/bpl_subset/boost/python.hpp:11,
                 from src/cpp/cuda.hpp:36,
                 from src/cpp/cuda.cpp:1:
bpl-subset/bpl_subset/boost/python/detail/wrap_python.hpp:50:23: fatal error: pyconfig.h: No such file or directory
compilation terminated.
error: command 'x86_64-linux-gnu-gcc' failed with exit status 1

我已经搜索了解决方案,似乎很多人建议安装python-dev,但我已经安装了此程序。

结果是我确实有pyconfig.h ...,但仍然出现错误,不确定如何解决,因此pip会看到此错误。

$ apt-file search pyconfig.h

libpython2.7-dbg: /usr/include/python2.7_d/pyconfig.h
libpython2.7-dbg: /usr/include/x86_64-linux-gnu/python2.7_d/pyconfig.h
libpython2.7-dev: /usr/include/python2.7/pyconfig.h
libpython2.7-dev: /usr/include/x86_64-linux-gnu/python2.7/pyconfig.h
libpython3.5-dbg: /usr/include/python3.5dm/pyconfig.h
libpython3.5-dbg: /usr/include/x86_64-linux-gnu/python3.5dm/pyconfig.h
libpython3.5-dev: /usr/include/python3.5m/pyconfig.h
libpython3.5-dev: /usr/include/x86_64-linux-gnu/python3.5m/pyconfig.h
pypy-dev: /usr/lib/pypy/include/pyconfig.h
python-numpy: /usr/lib/python2.7/dist-packages/numpy/core/include/numpy/_numpyconfig.h
python-numpy: /usr/lib/python2.7/distpackages/numpy/core/include/numpy/numpyconfig.h
python3-numpy:/usr/lib/python3/distpackages/numpy/core/include/numpy/_numpyconfig.h
python3-numpy:/usr/lib/python3/distpackages/numpy/core/include/numpy/numpyconfig.h

1 个答案:

答案 0 :(得分:0)

  

我需要python3-dev吗?   是的。

     

似乎不合适。

很奇怪,它肯定会显示在packages.debian.org上