我正在尝试安装引用器。但是运行配置时,它显示以下消息。
checking for python script directory... ${prefix}/lib/python3.6/site-packages
checking for python extension module directory...
${exec_prefix}/lib/python3.6/site-packages
checking for headers required to compile python extensions... File "string>",
line 1
import sys; print sys.prefix
^
SyntaxError: invalid syntax
File " string> ", line 1
import sys; print sys.exec_prefix
^
SyntaxError: invalid syntax
not found
configure: WARNING: Python not found, disabling python support
我安装了 python 软件包python-all-dev
和pygame
,并且pip
还安装了anaconda
,但问题仍然存在。我尝试继续而不下载所需的软件包,但是 make 文件需要它。
有人可以将我链接到所需的包吗?
答案1
Ubuntu 18.04(仿生海狸)将 python3 作为默认 python。
虽然您安装了基于 python2 的python-dev
头文件包,但是当软件的 configure 脚本实际调用时python
,却会导致调用python3
- 由于语法不兼容而失败:
checking for headers required to compile python extensions... File "<string>", line 1
import sys; print sys.prefix
^
SyntaxError: invalid syntax
File "<string>", line 1
import sys; print sys.exec_prefix
^
SyntaxError: invalid syntax
not found
configure: WARNING: Python not found, disabling python support
PYTHON=/usr/bin/python2
您可以通过在命令行上设置变量来覆盖默认值:
$ ./configure PYTHON=/usr/bin/python2
.
.
.
checking for /usr/bin/python2 version... 2.7
checking for /usr/bin/python2 platform... linux2
checking for /usr/bin/python2 script directory... ${prefix}/lib/python2.7/dist-packages
checking for /usr/bin/python2 extension module directory... ${exec_prefix}/lib/python2.7/dist-packages
checking for headers required to compile python extensions... found