【问题标题】:Getting python link error on OSX, PyMac_Error in linker flags在 OSX 上获取 python 链接错误,链接器标志中的 PyMac_Error
【发布时间】:2016-04-24 13:42:10
【问题描述】:

每当我尝试安装 CMU PocketSphinx 时,我都会收到错误消息:

checking for Python include path... -I/Library/Frameworks/Python.framework/Versions/2.7/include/python2.7
checking for Python library path... -L/Library/Frameworks/Python.framework/Versions/2.7/lib -lpython2.7
checking for Python site-packages path... /Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages
checking python extra libraries... -ldl  -framework CoreFoundation 
checking python extra linking flags... -u _PyMac_Error Python.framework/Versions/2.7/Python
checking consistency of all components of python development environment... no
configure: error: in `/Users/username/Desktop/CMUSPHINX/sphinxbase-5prealpha':
configure: error: 
  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.
  ===========================================================================    =

See `config.log' for more details

我尝试了“brew install python-dev”并运行了“brew install python”。我也试过'./configure LDFLAGS="-L/c/Python27/libs"',但它不起作用......

知道我做错了什么吗?

【问题讨论】:

    标签: python linker-errors cmusphinx pocketsphinx


    【解决方案1】:

    您在安装 python 时遇到问题。您系统上的 Python 功能失调,如下所述:

    Vim failing to compile with python on OS X

    您有以下选择:

    • 使用配置标志 --without-python 在没有 python 的情况下编译 sphinxbase
    • 如以上链接所述修复 python 安装
    • 删除 brew python 并从源/端口安装 python/使用本机 python

    【讨论】:

      【解决方案2】:

      运行以下命令对我有用:

      ./configure PYTHON_EXTRA_LDFLAGS='-u _PyMac_Error /usr/local/Cellar/python@2/2.7.15_1/Frameworks/Python.framework/Versions/2.7/Python'

      【讨论】:

        猜你喜欢
        • 1970-01-01
        • 2021-03-20
        • 2016-06-28
        • 2012-08-12
        • 1970-01-01
        • 1970-01-01
        • 2011-09-12
        • 1970-01-01
        相关资源
        最近更新 更多