【发布时间】:2014-05-08 19:08:16
【问题描述】:
我以前使用 Anaconda 来处理 python,但我现在开始使用虚拟环境。
我设置了 virtualenv 和 virtualenvwrapper,并一直在尝试为我想尝试的项目添加模块,特别是 scrapy 和 lxml。
每次我 pip 安装时,我都会遇到一个错误。
对于scrapy:
File "/home/philip/Envs/venv/local/lib/python2.7/site-packages/setuptools/command/easy_install.py", line 1003, in run_setup
raise DistutilsError("Setup script exited with %s" % (v.args[0],))
distutils.errors.DistutilsError: Setup script exited with error: command 'x86_64-linux-gnu-gcc' failed with exit status 1
---------------------------------------
Cleaning up...
Command python setup.py egg_info failed with error code 1 in /home/philip/Envs/venv/build/cryptography
Storing debug log for failure in /home/philip/.pip/pip.log
对于 lxml:
In file included from src/lxml/lxml.etree.c:346:0:
/home/philip/Envs/venv/build/lxml/src/lxml/includes/etree_defs.h:9:31: fatal error: libxml/xmlversion.h: No such file or directory
include "libxml/xmlversion.h"
^
compilation terminated.
error: command 'x86_64-linux-gnu-gcc' failed with exit status 1
----------------------------------------
Cleaning up... Command /home/philip/Envs/venv/bin/python -c "import setuptools, tokenize;__file__='/home/philip/Envs/venv/build/lxml/setup.py';exec(compile(getattr(tokenize, 'open', open)(__file__).read().replace('\r\n', '\n'), __file__, 'exec'))" install --record /tmp/pip-zIsPdl-record/install-record.txt
--single-version-externally-managed --compile --install-headers /home/philip/Envs/venv/include/site/python2.7 failed with error code 1 in /home/philip/Envs/venv/build/lxml Storing debug log for failure in /home/philip/.pip/pip.log
我尝试在scrapy's documentation之后安装它,但是当我调用python的已安装模块时仍然没有列出scrapy。
有什么想法吗?谢谢——真的很感激!
如果重要的话,我使用的是 Ubuntu 13.10。我尝试过的其他模块安装良好(虽然我只安装了少数)。
【问题讨论】:
-
对于scrapy,调试日志中是否有额外的信息?你有安装 OpenSSL 吗?
-
@jdigital 废话,感谢 openssl 提示!我安装了它,但没有安装开发库。把它改成那个就行了。唷。
-
嘿@user3115915 你能链接到开发库吗?遇到同样的问题,无法解决...