简体   繁体   English

配置:错误:Python.h 存在于 Ubuntu 18 时未找到

[英]configure: error: Python.h not found when it exists in Ubuntu 18

I am trying to run a ./configure --with-python file (I can attach it but it's long) and I am getting these errors:我正在尝试运行./configure --with-python文件(我可以附加它,但它很长)并且我收到了这些错误:

checking for gtest-config... no
File "<string>", line 1
import distutils.sysconfig; bl = distutils.sysconfig.get_config_var('BLDLIBRARY'); print bl if bl   else '-lpython2.7'
                                                                                              ^
SyntaxError: invalid syntax
File "<string>", line 1
import distutils.sysconfig; print distutils.sysconfig.get_config_var('INCLUDEPY')
                                              ^
SyntaxError: invalid syntax
checking Python.h usability... no
checking Python.h presence... no
checking for Python.h... no
configure: error: Python.h not found. Please install the devel package.

Next step, I run: locate Python.h which gives me:下一步,我运行: locate Python.h这给了我:

/usr/include/python2.7/Python.h
/usr/include/python3.6m/Python.h
/usr/include/python3.7m/Python.h

Next step, I run each of these:下一步,我运行其中的每一个:

./configure --with-python=/usr/bin/python2.7
./configure --with-python=/usr/bin/python3.6m
./configure --with-python=/usr/include/python3.6m/Python.h

With no luck.没有运气。

Any pointers on where the error can be?关于错误可能在哪里的任何指针? Thank you very much!非常感谢!

You are missing CFLAGS你缺少CFLAGS

./configure --with-python=/usr/bin/python2.7 CFLAGS="-I/usr/include/python2.7/

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM