我想在ubuntu 14.04上安装llvmpy.
uname -a
Linux -esktop 3.13.0-30-generic #55-Ubuntu SMP Fri Jul 4 21:40:53 UTC 2014 x86_64 x86_64 x86_64 GNU/Linux
lsb_release -a
LSB Version: core-2.0-amd64:core-2.0-noarch:core-3.0-amd64:core-3.0-noarch:core-3.1-amd64:core-3.1-noarch:core-3.2-amd64:core-3.2-noarch:core-4.0-amd64:core-4.0-noarch:core-4.1-amd64:core-4.1-noarch:security-4.0-amd64:security-4.0-noarch:security-4.1-amd64:security-4.1-noarch
Distributor ID: Ubuntu
Description: Ubuntu 14.04.1 LTS
Release: 14.04
Codename: trusty
Run Code Online (Sandbox Code Playgroud)
sudo pip install llvmpy失败.输出的结尾是
Cleaning up...
Command /usr/bin/python -c "import setuptools, tokenize;__file__='/tmp/pip_build_root/llvmpy/setup.py';exec(compile(getattr(tokenize, 'open', open)(__file__).read().replace('\r\n', '\n'), __file__, 'exec'))" install --record /tmp/pip-7HvRcB-record/install-record.txt --single-version-externally-managed --compile failed with error code 1 in /tmp/pip_build_root/llvmpy
Traceback (most recent call last):
File "/usr/bin/pip", line 9, in <module>
load_entry_point('pip==1.5.4', 'console_scripts', 'pip')()
File "/usr/lib/python2.7/dist-packages/pip/__init__.py", line 185, in main
return command.main(cmd_args)
File "/usr/lib/python2.7/dist-packages/pip/basecommand.py", line 161, in main
text = '\n'.join(complete_log)
UnicodeDecodeError: 'ascii' codec can't decode byte 0xe2 in position 42: ordinal not in range(128)
Run Code Online (Sandbox Code Playgroud)
我安装了llvm版本3.4.完整输出位于http://paste.ubuntu.com/8074574/.
llvmpy目前需要llvm 3.3.这是可用的,但不是Ubuntu 14.04上的默认值(默认为较新的llvm 3.4).首先,安装llvm3.3:
sudo apt-get install llvm-3.3 llvm-3.3-runtime
Run Code Online (Sandbox Code Playgroud)
然后,我们需要告诉pip使用旧的llvm.
sudo sh -c "LLVM_CONFIG_PATH=/usr/bin/llvm-config-3.3 pip install llvmpy"
Run Code Online (Sandbox Code Playgroud)
以上也适用于使用pip3的python3