配置:错误:在Ubuntu 18中找不到Python.h

问题描述

我正在尝试运行一个./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.

下一步,我运行:locate Python.h,这给了我:

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

下一步,我将运行其中的每一个:

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

没有运气。

任何有关错误可能在哪里的指针?非常感谢!

解决方法

暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!

如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。

小编邮箱:dio#foxmail.com (将#修改为@)