【发布时间】:2017-07-25 09:00:17
【问题描述】:
我遇到了问题:“无法将测试程序链接到 Python。”
我在 /Library/Frameworks/ 中安装了 2.7+ 版本。
我尝试过this solution,但由于它是在 6 年前发布的,它没有考虑 SIP(系统完整性保护),这使得许多用户无法更改 System/Library 文件。此外,在 Python 的更高版本中,Python 的 make 文件中的 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 从我的系统中剥离出来?那有必要吗?或者有解决这个错误的办法吗?
【问题讨论】:
-
真正的错误在您发布的行之上,如果您想了解问题,最好阅读完整的日志输出,而不仅仅是最后几行。
-
在这些行只是成功运行之前。它击中了蟒蛇并停了下来。我可能会发布更多内容,但我不确定是否有日志。
-
配置日志在 config.log 文件中
-
我已将其添加到我的 OP 中。
-
您没有添加实际错误,它在 config.log 中
标签: python homebrew pocketsphinx