我无法使用virtualenv和pip安装python-ldap。当我运行命令:pip:python-ldap - UnicodeDecodeError安装
pip install python-ldap
:
Cleaning up...
Command /opt/odoo/venv/bin/python -c "import setuptools, tokenize;__file__='/tmp/pip-1xwfhM-build/setup.py';exec(compile(getattr(tokenize, 'open', open)(__file__).read().replace('\r\n', '\n'), __file__, 'exec'))" install --record /tmp/pip-pjbP3I-record/install-record.txt --single-version-externally-managed --compile --install-headers /opt/odoo/venv/include/site/python2.7 failed with error code 1 in /tmp/pip-1xwfhM-build
Traceback (most recent call last):
File "/opt/odoo/venv/bin/pip", line 11, in <module>
sys.exit(main())
File "/opt/odoo/venv/lib/python2.7/site-packages/pip/__init__.py", line 185, in main
return command.main(cmd_args)
File "/opt/odoo/venv/lib/python2.7/site-packages/pip/basecommand.py", line 161, in main
text = '\n'.join(complete_log)
UnicodeDecodeError: 'ascii' codec can't decode byte 0xe2 in position 41: ordinal not in range(128)
我试图从这里下载最新版本:https://pypi.python.org/pypi/python-ldap#downloads,但似乎这就是相同的版本,因为它给了同样的错误。我在这里错过了什么,或者这个版本被窃听?
更新 我想我应该也包括这个错误信息。这又是一个前:
error: command 'gcc' failed with exit status 1
谢谢。忘了提到这一点,但是它会安装在virtualenv – Andrius 2014-10-20 13:05:17
之外请注意,您需要首先运行'sudo apt-get update'。 – Slark 2017-04-10 11:29:21