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

时间:2019-03-25 15:02:41

标签: python macos pip

我想使用pip(2.7)和libunicorn.dylib在macOS Mojave上安装Python独角兽。

我已经从源代码编译了Nicolass-MacBook-Pro:Tools nlykkei$ sudo find / -iname libunicorn.dylib 2>/dev/null /usr/local/lib/libunicorn.dylib ,如下所示:

libunicorn.dylib

当我尝试安装Python独角兽时,出现以下错误,即找不到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/ 中的库?

C:\test
    - test1
          - test-1-1
                    - DIR1
                          - 1.0
          - test-1-2
                    - DIR2  => Latest modified sub dir
                          - 1.1
    - test2
          - test-2-1 
                    - DIR1  => Latest modified sub dir
                          - 1.3
          - test-2-2
                    - DIR1
                          - 1.2

1 个答案:

答案 0 :(得分:1)

模块unicorn at PyPI似乎已经很旧了-版本1.0.1于2017年5月31日发布,而repository中的代码是最新的。

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

cd bindings/python
sudo python setup.py install

这将构建核心C库和python绑定。请参阅https://github.com/unicorn-engine/unicorn/tree/master/bindings/python

上的说明