SeanNaren / warp-ctc

Pytorch Bindings for warp-ctc
Apache License 2.0
756 stars 271 forks source link

fatal error: Python.h: No such file or directory #167

Closed FriedaSmith closed 4 years ago

FriedaSmith commented 4 years ago

when I run : python setup.py install --user in pytorch:1.0.0 , I come across the following problems:

Torch was not built with CUDA support, not building warp-ctc GPU extensions. running install running bdist_egg running egg_info writing warpctc_pytorch.egg-info/PKG-INFO writing dependency_links to warpctc_pytorch.egg-info/dependency_links.txt writing top-level names to warpctc_pytorch.egg-info/top_level.txt reading manifest file 'warpctc_pytorch.egg-info/SOURCES.txt' writing manifest file 'warpctc_pytorch.egg-info/SOURCES.txt' installing library code to build/bdist.linux-x86_64/egg running install_lib running build_py running build_ext building 'warpctc_pytorch._warp_ctc' extension x86_64-linux-gnu-gcc -pthread -Wno-unused-result -Wsign-compare -DNDEBUG -g -fwrapv -O2 -Wall -g -fstack-protector-strong -Wformat -Werror=format-security -g -fwrapv -O2 -g -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -fPIC -I/media/other/Code/Named-Entity-Recognition/tools/warp-ctc/include -I/home/ubuntu/.local/lib/python3.7/site-packages/torch/lib/include -I/home/ubuntu/.local/lib/python3.7/site-packages/torch/lib/include/torch/csrc/api/include -I/home/ubuntu/.local/lib/python3.7/site-packages/torch/lib/include/TH -I/home/ubuntu/.local/lib/python3.7/site-packages/torch/lib/include/THC -I/usr/include/python3.7m -c src/binding.cpp -o build/temp.linux-x86_64-3.7/src/binding.o -std=c++14 -fPIC -DTORCH_API_INCLUDE_EXTENSION_H -DTORCH_EXTENSION_NAME=_warp_ctc -D_GLIBCXX_USE_CXX11_ABI=0 In file included from /home/ubuntu/.local/lib/python3.7/site-packages/torch/lib/include/torch/csrc/api/include/torch/python.h:6, from /home/ubuntu/.local/lib/python3.7/site-packages/torch/lib/include/torch/extension.h:6, from src/binding.cpp:6: /home/ubuntu/.local/lib/python3.7/site-packages/torch/lib/include/torch/csrc/python_headers.h:9:10: fatal error: Python.h: No such file or directory 9 | #include | ^~~~~~ compilation terminated. error: command 'x86_64-linux-gnu-gcc' failed with exit status 1

Stonesjtu commented 4 years ago

You should install the header files of your python, e.g. on Ubuntu you can try sudo apt install python-dev

FriedaSmith commented 4 years ago

Thank you.