为了账号安全,请及时绑定邮箱和手机立即绑定

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

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

慕仙森 2023-05-16 14:50:44
我正在尝试运行一个./configure --with-python文件(我可以附加它,但它很长),但出现以下错误:checking for gtest-config... noFile "<string>", line 1import distutils.sysconfig; bl = distutils.sysconfig.get_config_var('BLDLIBRARY'); print bl if bl   else '-lpython2.7'                                                                                              ^SyntaxError: invalid syntaxFile "<string>", line 1import distutils.sysconfig; print distutils.sysconfig.get_config_var('INCLUDEPY')                                              ^SyntaxError: invalid syntaxchecking Python.h usability... nochecking Python.h presence... nochecking for Python.h... noconfigure: 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没有运气。关于错误可能出在哪里的任何指示?非常感谢!
查看完整描述

1 回答

?
幕布斯7119047

TA贡献1794条经验 获得超8个赞

你不见了CFLAGS

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


查看完整回答
反对 回复 2023-05-16
  • 1 回答
  • 0 关注
  • 222 浏览
慕课专栏
更多

添加回答

举报

0/150
提交
取消
意见反馈 帮助中心 APP下载
官方微信