我遇到了麻烦:“无法将测试程序链接到Python。”
我在/Library/Frameworks/中安装了版本的/Library/Frameworks/。
我尝试过this solution,但由于它是在6年前发布的,所以它不考虑SIP (系统完整性保护),这使得许多用户无法更改System/Library文件。此外,在Python的后期版本中,Python文件中的PYTHONFRAMEWORKDIR到PYTHONFRAMEWORKINSTALLDIR已经修复(但问题仍然存在)。
我试过:
./configure PYTHON_LDFLAGS="-l2.7.13_1"./configure LDFLAGS="-L/usr/local/Cellar/python/2.7.13_1/lib"…但联合使用LDFLAGS似乎没有效果。
以下是错误:
Could not link test program to Python. Maybe the main Python library has been
installed in some non-standard library path. If so, pass it to configure,
via the LDFLAGS environment variable.
Example: ./configure LDFLAGS="-L/usr/non-standard-path/python/lib"
============================================================================
ERROR!
You probably have to install the development version of the Python package
for your distribution. The exact name of this package varies among them.
============================================================================ 下面是日志描述:
PKG_CONFIG=''
PYTHON='/Library/Frameworks/Python.framework/Versions/2.7/bin/python'
PYTHON_CPPFLAGS='-I/Library/Frameworks/Python.framework/Versions/2.7/include/python2.7'
PYTHON_EXEC_PREFIX='${exec_prefix}'
PYTHON_EXTRA_LDFLAGS='-u _PyMac_Error Python.framework/Versions/2.7/Python'
PYTHON_EXTRA_LIBS='-ldl -framework CoreFoundation '
PYTHON_LDFLAGS='-L/Library/Frameworks/Python.framework/Versions/2.7/lib -lpython2.7'
PYTHON_PLATFORM='darwin'
PYTHON_PREFIX='${prefix}'
PYTHON_SITE_PKG='/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages'
PYTHON_VERSION='2.7'我如何才能把Python从我的系统中提取出来呢?这有必要吗?或者这个错误有修正吗?
发布于 2020-05-26 14:15:38
在我的机器上有相同的错误输出,对我来说,它有助于安装python-dev,所以
sudo apt-get install python-dev是为了我。
https://stackoverflow.com/questions/45298548
复制相似问题