致命错误:Python。h:没有这样的文件或目录。

时间:2021-01-30 05:32:08

I am trying to build a shared library using a C extension file but first I have to generate the output file using the command below:

我正在尝试使用C扩展文件构建一个共享库,但首先我必须使用下面的命令生成输出文件:

gcc -Wall utilsmodule.c -o Utilc

After executing the command, I get this error message:

执行该命令后,我得到这个错误消息:

utilsmodule.c:1:20: fatal error: Python.h: No such file or directory compilation terminated.

utilsmodule。c:1:20:致命错误:Python。h:没有终止这样的文件或目录编译。

in fact I have tried all the suggested solutions over the internet but the problem still exists ... also I have no problem with Python.h. I managed to locate the file on my machine ... anybody has faced the same problem before??

事实上,我已经在网上尝试了所有建议的解决方案,但问题仍然存在……而且我对蟒蛇也没有问题。我设法找到了我机器上的文件…有人以前遇到过同样的问题吗?

23 个解决方案

#1


1238  

Looks like you haven't properly installed the header files and static libraries for python dev. Use your package manager to install them system-wide.

看起来您还没有正确地安装python dev的头文件和静态库。请使用您的包管理器在系统范围内安装它们。

For apt (Ubuntu, Debian...):

apt(Ubuntu,Debian…):

sudo apt-get install python-dev   # for python2.x installs
sudo apt-get install python3-dev  # for python3.x installs

For yum (CentOS, RHEL...):

百胜(CentOS RHEL…):

sudo yum install python-devel   # for python2.x installs
sudo yum install python34-devel   # for python3.4 installs

For dnf (Fedora...):

dnf(Fedora…):

sudo dnf install python2-devel  # for python2.x installs
sudo dnf install python3-devel  # for python3.x installs

For zypper (openSUSE...):

zypper(openSUSE…):

sudo zypper in python-devel   # for python2.x installs
sudo zypper in python3-devel  # for python3.x installs

#2


208  

On Ubuntu, I was running Python 3 and I had to install

在Ubuntu上,我运行的是Python 3,我必须安装。

sudo apt-get install python3-dev

If you want to use a version of Python that is not linked to python3, install the associated python3.x-dev package. For example:

如果您想使用与python3没有关联的Python版本,请安装相关的python3。x-dev包。例如:

sudo apt-get install python3.5-dev

#3


51  

Two things you have to do.

你必须做两件事。

Install development package for Python, in case of Debian/Ubuntu/Mint it's done with command:

为Python安装开发包,在Debian/Ubuntu/Mint中使用命令:

sudo apt-get install python-dev

Second thing is that include files are not by default in the include path, nor is Python library linked with executable by default. You need to add these flags (replace Python's version accordingly):

第二件事是,包括文件在include路径中不是默认的,也不是默认情况下与可执行文件链接的Python库。您需要添加这些标志(相应地替换Python的版本):

-I/usr/include/python2.7 -lpython2.7 

In other words your compile command ought to be:

换句话说,您的编译命令应该是:

gcc -Wall -I/usr/include/python2.7 -lpython2.7  utilsmodule.c -o Utilc 

#4


41  

If you are using a Raspberry Pi:

如果你使用的是树莓派:

sudo apt-get install python-dev

#5


30  

on Fedora run this for Python 2:

在Fedora上为python2运行这个:

sudo dnf install python2-devel

and for Python 3:

对于Python 3:

sudo dnf install python3-devel

#6


23  

If you are using tox to run tests on multiple versions of Python, you may need to install the Python dev libraries for each version of Python you are testing on.

如果您正在使用tox来在Python的多个版本上运行测试,那么您可能需要为您正在测试的每一个Python版本安装Python开发库。

sudo apt-get install python2.6-dev 
sudo apt-get install python2.7-dev 
etc.

#7


17  

I would like to add also the solution for Cygwin:

我想补充一下Cygwin的解决方案:

You need to install the package python2-devel or python3-devel, depending on the Python version you're using.

您需要安装包python2-devel或python3-devel,这取决于您使用的Python版本。

You can quickly install it using the 32-bit or 64-bit setup.exe (depending on your installation) from Cygwin.com.

您可以使用32位或64位设置快速安装它。exe(取决于您的安装)来自Cygwin.com。

Example (modify setup.exe's filename and Python's major version if you need):

示例(修改设置。如果需要,exe的文件名和Python的主要版本):

$ setup.exe -q --packages=python3-devel

You can also check my other answer for a few more options to install Cygwin's packages from the command-line.

您还可以检查我的其他答案,以便从命令行安装Cygwin的包。

#8


16  

In AWS API (centOS) its

在AWS API (centOS)中。

yum install python27-devel

#9


15  

For me, changing it to this worked:

对我来说,把它变成这样:

#include <python2.7/Python.h>

I found the file /usr/include/python2.7/Python.h, and since /usr/include is already in the include path, then python2.7/Python.h should be sufficient.

我找到了文件/usr/include/python2.7/ python。h,因为/usr/include已经包含在include路径中,然后是python2.7/Python。h应该足够了。

You could also add the include path from command line instead - gcc -I/usr/lib/python2.7 (thanks @erm3nda).

您还可以从命令行添加include路径,而不是- gcc - i /usr/lib/python2.7(谢谢@erm3nda)。

#10


13  

AWS EC2 install running python34:

AWS EC2安装运行python34:

sudo yum install python34-devel

sudo yum安装python34-devel

#11


12  

Make sure that the Python dev files come with your OS.

请确保Python dev文件与您的操作系统一起出现。

You should not hard code the library and include paths. Instead, use pkg-config, which will output the correct options for your specific system:

您不应该硬编码库和包含路径。相反,使用pkg-config,它将为您的特定系统输出正确的选项:

$ pkg-config --cflags --libs python2
-I/usr/include/python2.7 -lpython2.7

You may add it to your gcc line:

您可以将其添加到您的gcc系列中:

gcc $(pkg-config --cflags --libs python2) -Wall utilsmodule.c -o Utilc

#12


11  

In my case, what fixed it in Ubuntu was to install the packages libpython-all-dev (or libpython3-all-dev if you use Python 3).

在我的例子中,在Ubuntu中修复的是安装libpythonall -dev(或者libpython3-all-dev,如果您使用Python 3)。

#13


11  

If you use a virtualenv with a 3.6 python (edge right now), be sure to install the matching python 3.6 dev sudo apt-get install python3.6-dev, otherwise executing sudo python3-dev will install the python dev 3.3.3-1, which won't solve the issue.

如果您使用的是一个具有3.6 python(现在是edge)的virtualenv,请确保安装匹配的python3.6 dev sudo apt-get安装python3.6-dev,否则执行sudo python3-dev将安装python dev 3.3.3-1,这将解决不了问题。

#14


10  

I managed to solve this issue and generate the .so file in one command

我成功地解决了这个问题,并在一个命令中生成了so文件。

gcc -shared -o UtilcS.so
-fPIC -I/usr/include/python2.7 -lpython2.7  utilsmodule.c

#15


8  

try apt-file. It is difficult to remember the package name where the missing file resides. It is generic and useful for any package files.

apt-file试试。很难记住丢失文件所在的包名。它是通用的,对任何包文件都有用。

For example:

例如:

root@ubuntu234:~/auto# apt-file search --regexp '/Python.h$'
pypy-dev: /usr/lib/pypy/include/Python.h
python2.7-dbg: /usr/include/python2.7_d/Python.h
python2.7-dev: /usr/include/python2.7/Python.h
python3.2-dbg: /usr/include/python3.2dmu/Python.h
python3.2-dev: /usr/include/python3.2mu/Python.h
root@ubuntu234:~/auto# 

Now you can make an expert guess as to which one to choose from.

现在你可以做出一个专家的猜测来选择哪一个。

#16


7  

For the OpenSuse comrades out there:

对于OpenSuse的同志们来说:

sudo zypper install python3-devel

#17


7  

It's not the same situation, but it also works for me and now I can use SWIG with Python3.5:

这不是同样的情况,但它对我也适用,现在我可以用Python3.5来使用SWIG:

I was trying to compile:

我试图编译:

gcc -fPIC -c existe.c existe_wrap.c -I /usr/include/python3.5m/

gcc - fpic - c存在。c existe_wrap。c - i /usr/include/python3.5m/

With Python 2.7 works fine, not with my version 3.5:

使用Python 2.7可以正常工作,而不是我的版本3.5:

existe_wrap.c:147:21: fatal error: Python.h: No existe el archivo o el directorio compilation terminated.

existe_wrap。c:147:21:致命错误:Python。h:没有任何一份文件被终止。

After run in my Ubuntu 16.04 installation:

在我的Ubuntu 16.04安装运行后:

sudo apt-get install python3-dev  # for python3.x installs

Now I can compile without problems Python3.5:

现在我可以毫无问题地编译了Python3.5:

gcc -fPIC -c existe.c existe_wrap.c -I /usr/include/python3.5m/

#18


6  

For CentOS 7:

为CentOS 7:

sudo yum install python36u-devel

I followed the instructions here for installing python3.6 on several VMs: https://www.digitalocean.com/community/tutorials/how-to-install-python-3-and-set-up-a-local-programming-environment-on-centos-7 and was then able to build mod_wsgi and get it working with a python3.6 virtualenv

我遵循这里的说明,在几个VMs上安装了python3.6: https://www.digitalocean.com/community/tutorials/howto -install- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

#19


3  

This error occurred when I attempted to install ctds on CentOS 7 with Python3.6. I did all the tricks mentioned here including yum install python34-devel. The problem was Python.h was found in /usr/include/python3.4m but not in /usr/include/python3.6m. I tried to use --global-option to point to include dir (pip3.6 install --global-option=build_ext --global-option="--include-dirs=/usr/include/python3.4m" ctds). This resulted in a lpython3.6m not found when linking ctds.

当我试图用Python3.6在CentOS 7上安装ctds时发生了这个错误。我做了这里提到的所有技巧,包括yum安装python34-devel。问题是Python。h是在/usr/ include/python34m中发现的,但不在/usr/ include/python360中。我尝试使用——全局选项来指向包括dir (pip3.6安装—global-option=build_ext -global-option="- includedirs =/usr/include/ python340 .4m" ctds)。这导致了在连接ctds时没有发现的lpython360。

Finally what worked was fixing the development environment for Python3.6 needs to correct with the include and libs.

最后工作的是为Python3.6修复开发环境,需要对include和libs进行纠正。

yum -y install https://dl.iuscommunity.org/pub/ius/stable/CentOS/7/x86_64/python36u-libs-3.6.3-1.ius.centos7.x86_64.rpm

Python.h needs to be in your include path for gcc. Whichever version of python is used, for example if it's 3.6, then it should be in /usr/include/python3.6m/Python.h typically.

Python。h需要在包含gcc的路径中。无论使用哪个版本的python,例如如果它是3.6,那么它应该在/usr/ include/python3.6m/python。h一般。

#20


1  

Sure python-dev or libpython-all-dev are the first thing to (apt )install, but if that doesn't help as was my case, I advice you to install the foreign Function Interface packages by sudo apt-get install libffi-dev and pip install cffi.

当然,python-dev或libpython-all-dev是第一个(apt)安装的东西,但是如果这对我的情况没有帮助,那么我建议您安装sudo apt-get安装的外部函数接口包,安装libffi-dev和pip安装cffi。

This should help out especially if you see the error as/from c/_cffi_backend.c:2:20: fatal error: Python.h: No such file or directory.

这应该会有帮助,尤其是当您看到c/ _cffi_backup的错误时。c:2:20:致命错误:Python。h:没有这样的文件或目录。

#21


0  

This means that Python.h isn't in your compiler's default include paths. Have you installed it system-wide or locally? What's your OS?

这意味着Python。h不在编译器的默认包含路径中。您已经在系统范围内或本地安装了它吗?你的操作系统是什么?

You could use the -I<path> flag to specify an additional directory where your compiler should look for headers. You will probably have to follow up with -L<path> so that gcc can find the library you'll be linking with using -l<name>.

您可以使用-I 标志来指定一个额外的目录,在这个目录中,编译器应该查找标题。您可能需要跟踪-L ,以便gcc可以找到您要链接的库,使用-L< name>。

#22


0  

If you're using Python 3.6 on Amazon Linux (based on RHEL, but the RHEL answers given here didn't work):

如果您在Amazon Linux上使用Python 3.6(基于RHEL,但是此处给出的RHEL答案没有工作):

sudo yum install python36-devel

#23


0  

It often appear when you trying to remove python3.5 and install python3.6.

当您试图删除python3.5并安装python3.6时,它经常出现。

So when using python3 (which python3 -V => python3.6) to install some packages required python3.5 header will appear this error.

因此,当使用python3 (python3 -V => python3.6)安装一些包时,需要python3.5的报头会出现这个错误。

Resolve by install python3.6-dev module.

通过安装python3.6-dev模块解决。

#1


1238  

Looks like you haven't properly installed the header files and static libraries for python dev. Use your package manager to install them system-wide.

看起来您还没有正确地安装python dev的头文件和静态库。请使用您的包管理器在系统范围内安装它们。

For apt (Ubuntu, Debian...):

apt(Ubuntu,Debian…):

sudo apt-get install python-dev   # for python2.x installs
sudo apt-get install python3-dev  # for python3.x installs

For yum (CentOS, RHEL...):

百胜(CentOS RHEL…):

sudo yum install python-devel   # for python2.x installs
sudo yum install python34-devel   # for python3.4 installs

For dnf (Fedora...):

dnf(Fedora…):

sudo dnf install python2-devel  # for python2.x installs
sudo dnf install python3-devel  # for python3.x installs

For zypper (openSUSE...):

zypper(openSUSE…):

sudo zypper in python-devel   # for python2.x installs
sudo zypper in python3-devel  # for python3.x installs

#2


208  

On Ubuntu, I was running Python 3 and I had to install

在Ubuntu上,我运行的是Python 3,我必须安装。

sudo apt-get install python3-dev

If you want to use a version of Python that is not linked to python3, install the associated python3.x-dev package. For example:

如果您想使用与python3没有关联的Python版本,请安装相关的python3。x-dev包。例如:

sudo apt-get install python3.5-dev

#3


51  

Two things you have to do.

你必须做两件事。

Install development package for Python, in case of Debian/Ubuntu/Mint it's done with command:

为Python安装开发包,在Debian/Ubuntu/Mint中使用命令:

sudo apt-get install python-dev

Second thing is that include files are not by default in the include path, nor is Python library linked with executable by default. You need to add these flags (replace Python's version accordingly):

第二件事是,包括文件在include路径中不是默认的,也不是默认情况下与可执行文件链接的Python库。您需要添加这些标志(相应地替换Python的版本):

-I/usr/include/python2.7 -lpython2.7 

In other words your compile command ought to be:

换句话说,您的编译命令应该是:

gcc -Wall -I/usr/include/python2.7 -lpython2.7  utilsmodule.c -o Utilc 

#4


41  

If you are using a Raspberry Pi:

如果你使用的是树莓派:

sudo apt-get install python-dev

#5


30  

on Fedora run this for Python 2:

在Fedora上为python2运行这个:

sudo dnf install python2-devel

and for Python 3:

对于Python 3:

sudo dnf install python3-devel

#6


23  

If you are using tox to run tests on multiple versions of Python, you may need to install the Python dev libraries for each version of Python you are testing on.

如果您正在使用tox来在Python的多个版本上运行测试,那么您可能需要为您正在测试的每一个Python版本安装Python开发库。

sudo apt-get install python2.6-dev 
sudo apt-get install python2.7-dev 
etc.

#7


17  

I would like to add also the solution for Cygwin:

我想补充一下Cygwin的解决方案:

You need to install the package python2-devel or python3-devel, depending on the Python version you're using.

您需要安装包python2-devel或python3-devel,这取决于您使用的Python版本。

You can quickly install it using the 32-bit or 64-bit setup.exe (depending on your installation) from Cygwin.com.

您可以使用32位或64位设置快速安装它。exe(取决于您的安装)来自Cygwin.com。

Example (modify setup.exe's filename and Python's major version if you need):

示例(修改设置。如果需要,exe的文件名和Python的主要版本):

$ setup.exe -q --packages=python3-devel

You can also check my other answer for a few more options to install Cygwin's packages from the command-line.

您还可以检查我的其他答案,以便从命令行安装Cygwin的包。

#8


16  

In AWS API (centOS) its

在AWS API (centOS)中。

yum install python27-devel

#9


15  

For me, changing it to this worked:

对我来说,把它变成这样:

#include <python2.7/Python.h>

I found the file /usr/include/python2.7/Python.h, and since /usr/include is already in the include path, then python2.7/Python.h should be sufficient.

我找到了文件/usr/include/python2.7/ python。h,因为/usr/include已经包含在include路径中,然后是python2.7/Python。h应该足够了。

You could also add the include path from command line instead - gcc -I/usr/lib/python2.7 (thanks @erm3nda).

您还可以从命令行添加include路径,而不是- gcc - i /usr/lib/python2.7(谢谢@erm3nda)。

#10


13  

AWS EC2 install running python34:

AWS EC2安装运行python34:

sudo yum install python34-devel

sudo yum安装python34-devel

#11


12  

Make sure that the Python dev files come with your OS.

请确保Python dev文件与您的操作系统一起出现。

You should not hard code the library and include paths. Instead, use pkg-config, which will output the correct options for your specific system:

您不应该硬编码库和包含路径。相反,使用pkg-config,它将为您的特定系统输出正确的选项:

$ pkg-config --cflags --libs python2
-I/usr/include/python2.7 -lpython2.7

You may add it to your gcc line:

您可以将其添加到您的gcc系列中:

gcc $(pkg-config --cflags --libs python2) -Wall utilsmodule.c -o Utilc

#12


11  

In my case, what fixed it in Ubuntu was to install the packages libpython-all-dev (or libpython3-all-dev if you use Python 3).

在我的例子中,在Ubuntu中修复的是安装libpythonall -dev(或者libpython3-all-dev,如果您使用Python 3)。

#13


11  

If you use a virtualenv with a 3.6 python (edge right now), be sure to install the matching python 3.6 dev sudo apt-get install python3.6-dev, otherwise executing sudo python3-dev will install the python dev 3.3.3-1, which won't solve the issue.

如果您使用的是一个具有3.6 python(现在是edge)的virtualenv,请确保安装匹配的python3.6 dev sudo apt-get安装python3.6-dev,否则执行sudo python3-dev将安装python dev 3.3.3-1,这将解决不了问题。

#14


10  

I managed to solve this issue and generate the .so file in one command

我成功地解决了这个问题,并在一个命令中生成了so文件。

gcc -shared -o UtilcS.so
-fPIC -I/usr/include/python2.7 -lpython2.7  utilsmodule.c

#15


8  

try apt-file. It is difficult to remember the package name where the missing file resides. It is generic and useful for any package files.

apt-file试试。很难记住丢失文件所在的包名。它是通用的,对任何包文件都有用。

For example:

例如:

root@ubuntu234:~/auto# apt-file search --regexp '/Python.h$'
pypy-dev: /usr/lib/pypy/include/Python.h
python2.7-dbg: /usr/include/python2.7_d/Python.h
python2.7-dev: /usr/include/python2.7/Python.h
python3.2-dbg: /usr/include/python3.2dmu/Python.h
python3.2-dev: /usr/include/python3.2mu/Python.h
root@ubuntu234:~/auto# 

Now you can make an expert guess as to which one to choose from.

现在你可以做出一个专家的猜测来选择哪一个。

#16


7  

For the OpenSuse comrades out there:

对于OpenSuse的同志们来说:

sudo zypper install python3-devel

#17


7  

It's not the same situation, but it also works for me and now I can use SWIG with Python3.5:

这不是同样的情况,但它对我也适用,现在我可以用Python3.5来使用SWIG:

I was trying to compile:

我试图编译:

gcc -fPIC -c existe.c existe_wrap.c -I /usr/include/python3.5m/

gcc - fpic - c存在。c existe_wrap。c - i /usr/include/python3.5m/

With Python 2.7 works fine, not with my version 3.5:

使用Python 2.7可以正常工作,而不是我的版本3.5:

existe_wrap.c:147:21: fatal error: Python.h: No existe el archivo o el directorio compilation terminated.

existe_wrap。c:147:21:致命错误:Python。h:没有任何一份文件被终止。

After run in my Ubuntu 16.04 installation:

在我的Ubuntu 16.04安装运行后:

sudo apt-get install python3-dev  # for python3.x installs

Now I can compile without problems Python3.5:

现在我可以毫无问题地编译了Python3.5:

gcc -fPIC -c existe.c existe_wrap.c -I /usr/include/python3.5m/

#18


6  

For CentOS 7:

为CentOS 7:

sudo yum install python36u-devel

I followed the instructions here for installing python3.6 on several VMs: https://www.digitalocean.com/community/tutorials/how-to-install-python-3-and-set-up-a-local-programming-environment-on-centos-7 and was then able to build mod_wsgi and get it working with a python3.6 virtualenv

我遵循这里的说明,在几个VMs上安装了python3.6: https://www.digitalocean.com/community/tutorials/howto -install- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

#19


3  

This error occurred when I attempted to install ctds on CentOS 7 with Python3.6. I did all the tricks mentioned here including yum install python34-devel. The problem was Python.h was found in /usr/include/python3.4m but not in /usr/include/python3.6m. I tried to use --global-option to point to include dir (pip3.6 install --global-option=build_ext --global-option="--include-dirs=/usr/include/python3.4m" ctds). This resulted in a lpython3.6m not found when linking ctds.

当我试图用Python3.6在CentOS 7上安装ctds时发生了这个错误。我做了这里提到的所有技巧,包括yum安装python34-devel。问题是Python。h是在/usr/ include/python34m中发现的,但不在/usr/ include/python360中。我尝试使用——全局选项来指向包括dir (pip3.6安装—global-option=build_ext -global-option="- includedirs =/usr/include/ python340 .4m" ctds)。这导致了在连接ctds时没有发现的lpython360。

Finally what worked was fixing the development environment for Python3.6 needs to correct with the include and libs.

最后工作的是为Python3.6修复开发环境,需要对include和libs进行纠正。

yum -y install https://dl.iuscommunity.org/pub/ius/stable/CentOS/7/x86_64/python36u-libs-3.6.3-1.ius.centos7.x86_64.rpm

Python.h needs to be in your include path for gcc. Whichever version of python is used, for example if it's 3.6, then it should be in /usr/include/python3.6m/Python.h typically.

Python。h需要在包含gcc的路径中。无论使用哪个版本的python,例如如果它是3.6,那么它应该在/usr/ include/python3.6m/python。h一般。

#20


1  

Sure python-dev or libpython-all-dev are the first thing to (apt )install, but if that doesn't help as was my case, I advice you to install the foreign Function Interface packages by sudo apt-get install libffi-dev and pip install cffi.

当然,python-dev或libpython-all-dev是第一个(apt)安装的东西,但是如果这对我的情况没有帮助,那么我建议您安装sudo apt-get安装的外部函数接口包,安装libffi-dev和pip安装cffi。

This should help out especially if you see the error as/from c/_cffi_backend.c:2:20: fatal error: Python.h: No such file or directory.

这应该会有帮助,尤其是当您看到c/ _cffi_backup的错误时。c:2:20:致命错误:Python。h:没有这样的文件或目录。

#21


0  

This means that Python.h isn't in your compiler's default include paths. Have you installed it system-wide or locally? What's your OS?

这意味着Python。h不在编译器的默认包含路径中。您已经在系统范围内或本地安装了它吗?你的操作系统是什么?

You could use the -I<path> flag to specify an additional directory where your compiler should look for headers. You will probably have to follow up with -L<path> so that gcc can find the library you'll be linking with using -l<name>.

您可以使用-I 标志来指定一个额外的目录,在这个目录中,编译器应该查找标题。您可能需要跟踪-L ,以便gcc可以找到您要链接的库,使用-L< name>。

#22


0  

If you're using Python 3.6 on Amazon Linux (based on RHEL, but the RHEL answers given here didn't work):

如果您在Amazon Linux上使用Python 3.6(基于RHEL,但是此处给出的RHEL答案没有工作):

sudo yum install python36-devel

#23


0  

It often appear when you trying to remove python3.5 and install python3.6.

当您试图删除python3.5并安装python3.6时,它经常出现。

So when using python3 (which python3 -V => python3.6) to install some packages required python3.5 header will appear this error.

因此,当使用python3 (python3 -V => python3.6)安装一些包时,需要python3.5的报头会出现这个错误。

Resolve by install python3.6-dev module.

通过安装python3.6-dev模块解决。