Python 设置在macOS上使用pip安装unicorn的库路径(缺少libunicorn.dylib)

Python 设置在macOS上使用pip安装unicorn的库路径(缺少libunicorn.dylib),python,macos,pip,Python,Macos,Pip,我想使用Python(2.7)和pip在macOS Mojave上安装Python unicorn 我已经从源代码处编译了libunicorn.dylib,如下所示: Nicolass-MacBook-Pro:Tools nlykkei$ sudo find / -iname libunicorn.dylib 2>/dev/null /usr/local/lib/libunicorn.dylib 当我尝试安装PythonUnicorn时,我得到以下错误,即找不到libunicorn.dy

我想使用
Python
(2.7)和
pip
在macOS Mojave上安装Python unicorn

我已经从源代码处编译了
libunicorn.dylib
,如下所示:

Nicolass-MacBook-Pro:Tools nlykkei$ sudo find / -iname libunicorn.dylib 2>/dev/null
/usr/local/lib/libunicorn.dylib
当我尝试安装PythonUnicorn时,我得到以下错误,即找不到
libunicorn.dylib
。如何使
pip
使用
/usr/local/lib
中的库

Nicolass-MacBook-Pro:Tools nlykkei$ UNICORN_QEMU_FLAGS="--python=/opt/local/bin/python" pip install unicorn
DEPRECATION: Python 2.7 will reach the end of its life on January 1st, 2020. Please upgrade your Python as Python 2.7 won't be maintained after that date. A future version of pip will drop support for Python 2.7.
Collecting unicorn
  Using cached https://files.pythonhosted.org/packages/7d/7f/47fe864fe967e91de2d57677618cffc91bee3918f0a3cdbaa6500b36855e/unicorn-1.0.1.tar.gz
Building wheels for collected packages: unicorn
  Building wheel for unicorn (setup.py) ... error
  Complete output from command /opt/local/Library/Frameworks/Python.framework/Versions/2.7/Resources/Python.app/Contents/MacOS/Python -u -c "import setuptools, tokenize;__file__='/private/var/folders/qg/d7f5_p4j1px1gqb9c3xxl80w0000gn/T/pip-install-5zSTD0/unicorn/setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, __file__, 'exec'))" bdist_wheel -d /private/var/folders/qg/d7f5_p4j1px1gqb9c3xxl80w0000gn/T/pip-wheel-5V3QqP --python-tag cp27:
  running bdist_wheel
  running build
  Building C extensions
  cd qemu && \
    ./configure --cc="cc" --extra-cflags="-DUNICORN_HAS_X86 -DUNICORN_HAS_ARM -DUNICORN_HAS_ARMEB -DUNICORN_HAS_M68K -DUNICORN_HAS_ARM64 -DUNICORN_HAS_MIPS -DUNICORN_HAS_MIPSEL -DUNICORN_HAS_MIPS64 -DUNICORN_HAS_MIPS64EL -DUNICORN_HAS_SPARC -fPIC -fvisibility=hidden -m32 -arch i386 -m64 -arch x86_64" --target-list="x86_64-softmmu, arm-softmmu, armeb-softmmu, m68k-softmmu, aarch64-softmmu, mips-softmmu, mipsel-softmmu, mips64-softmmu, mips64el-softmmu, sparc-softmmu,sparc64-softmmu," --python=/opt/local/bin/python

  ERROR: pthread check failed
         Make sure to have the pthread libs and headers installed.

  make: *** [qemu/config-host.h-timestamp] Error 1
  error: [Errno 2] No such file or directory: 'libunicorn.dylib'

  ----------------------------------------
  Failed building wheel for unicorn
  Running setup.py clean for unicorn
Failed to build unicorn
Installing collected packages: unicorn
  Running setup.py install for unicorn ... error
    Complete output from command /opt/local/Library/Frameworks/Python.framework/Versions/2.7/Resources/Python.app/Contents/MacOS/Python -u -c "import setuptools, tokenize;__file__='/private/var/folders/qg/d7f5_p4j1px1gqb9c3xxl80w0000gn/T/pip-install-5zSTD0/unicorn/setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, __file__, 'exec'))" install --record /private/var/folders/qg/d7f5_p4j1px1gqb9c3xxl80w0000gn/T/pip-record-iBB9QD/install-record.txt --single-version-externally-managed --compile:
    running install
    running build
    Building C extensions
    cd qemu && \
        ./configure --cc="cc" --extra-cflags="-DUNICORN_HAS_X86 -DUNICORN_HAS_ARM -DUNICORN_HAS_ARMEB -DUNICORN_HAS_M68K -DUNICORN_HAS_ARM64 -DUNICORN_HAS_MIPS -DUNICORN_HAS_MIPSEL -DUNICORN_HAS_MIPS64 -DUNICORN_HAS_MIPS64EL -DUNICORN_HAS_SPARC -fPIC -fvisibility=hidden -m32 -arch i386 -m64 -arch x86_64" --target-list="x86_64-softmmu, arm-softmmu, armeb-softmmu, m68k-softmmu, aarch64-softmmu, mips-softmmu, mipsel-softmmu, mips64-softmmu, mips64el-softmmu, sparc-softmmu,sparc64-softmmu," --python=/opt/local/bin/python

    ERROR: pthread check failed
           Make sure to have the pthread libs and headers installed.

    make: *** [qemu/config-host.h-timestamp] Error 1
    error: [Errno 2] No such file or directory: 'libunicorn.dylib'

    ----------------------------------------
Command "/opt/local/Library/Frameworks/Python.framework/Versions/2.7/Resources/Python.app/Contents/MacOS/Python -u -c "import setuptools, tokenize;__file__='/private/var/folders/qg/d7f5_p4j1px1gqb9c3xxl80w0000gn/T/pip-install-5zSTD0/unicorn/setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, __file__, 'exec'))" install --record /private/var/folders/qg/d7f5_p4j1px1gqb9c3xxl80w0000gn/T/pip-record-iBB9QD/install-record.txt --single-version-externally-managed --compile" failed with error code 1 in /private/var/folders/qg/d7f5_p4j1px1gqb9c3xxl80w0000gn/T/pip-install-5zSTD0/unicorn/
该模块似乎比较旧—1.0.1版于2017年5月31日发布,而中的代码是新的

克隆存储库并使用以下命令安装:

cd bindings/python
sudo python setup.py install
这将构建核心C库和python绑定。请参见

中的说明,模块似乎比较旧-版本1.0.1于2017年5月31日发布,而中的代码是新的

克隆存储库并使用以下命令安装:

cd bindings/python
sudo python setup.py install

这将构建核心C库和python绑定。请参阅

@phd上的说明-使用pip时如何编辑makefile?@phd-它起作用了!非常感谢。但是为什么它不能与pip一起工作呢?是不是因为pip试图安装未修复的旧unicorn源代码?(第1075期明确指出,更新版本的unicorn已修复了该问题)。
pip
是否试图安装旧unicorn?是的,我想是的。当前版本是2017年发布的1.0.1。@phd-使用pip时如何编辑makefile?@phd-它工作了!非常感谢。但是为什么它不能与pip一起工作呢?是不是因为pip试图安装未修复的旧unicorn源代码?(第1075期明确指出,更新版本的unicorn已修复了该问题)。
pip
是否试图安装旧unicorn?是的,我想是的。当前版本为2017年发布的1.0.1。