【发布时间】:2014-02-07 22:44:15
【问题描述】:
我在 Amazon EC2 中安装 lxml 时遇到问题。我有一个 Linux 实例。我输入了以下命令。
sudo pip install lxml
现在,它不工作。它只会产生以下错误。
[root@ip-10-252-54-226 ec2-user]# sudo pip install lxml
Downloading/unpacking lxml
Downloading lxml-3.2.5.tar.gz (3.3MB): 3.3MB downloaded
Running setup.py (path:/tmp/pip_build_root/lxml/setup.py) egg_info for package lxml
/usr/lib/python2.6/distutils/dist.py:266: UserWarning: Unknown distribution option: 'bugtrack_url'
warnings.warn(msg)
/usr/lib/python2.6/distutils/dist.py:266: UserWarning: Unknown distribution option: 'zip_safe'
warnings.warn(msg)
Building lxml version 3.2.5.
Building without Cython.
Using build configuration of libxslt 1.1.26
Building against libxml2/libxslt in the following directory: /usr/lib
usage: -c [global_opts] cmd1 [cmd1_opts] [cmd2 [cmd2_opts] ...]
or: -c --help [cmd1 cmd2 ...]
or: -c --help-commands
or: -c cmd --help
error: invalid command 'egg_info'
Complete output from command python setup.py egg_info:
/usr/lib/python2.6/distutils/dist.py:266: UserWarning: Unknown distribution option: 'bugtrack_url'
warnings.warn(msg)
/usr/lib/python2.6/distutils/dist.py:266: UserWarning: Unknown distribution option: 'zip_safe'
warnings.warn(msg)
Building lxml version 3.2.5.
Building without Cython.
Using build configuration of libxslt 1.1.26
Building against libxml2/libxslt in the following directory: /usr/lib
usage: -c [global_opts] cmd1 [cmd1_opts] [cmd2 [cmd2_opts] ...]
or: -c --help [cmd1 cmd2 ...]
or: -c --help-commands
or: -c cmd --help
error: invalid command 'egg_info'
这里有什么问题?我该如何安装?
更新
我使用了pip install --upgrade setuptools。现在我得到了以下内容。
[ec2-user@ip-10-252-54-226 ~]$ pip install --upgrade setuptools
Downloading/unpacking setuptools from https://pypi.python.org/packages/3.4/s/setuptools/setuptools-2.1-py2.py3-none-any.whl#md5=be57ff5b99882a20f5987cacc0e72893
Downloading setuptools-2.1-py2.py3-none-any.whl (540kB): 540kB downloaded
Installing collected packages: setuptools
Found existing installation: setuptools 0.6c11
Uninstalling setuptools:
Cleaning up...
Exception:
Traceback (most recent call last):
File "/usr/lib/python2.6/site-packages/pip-1.5-py2.6.egg/pip/basecommand.py", line 122, in main
status = self.run(options, args)
File "/usr/lib/python2.6/site-packages/pip-1.5-py2.6.egg/pip/commands/install.py", line 275, in run
requirement_set.install(install_options, global_options, root=options.root_path)
File "/usr/lib/python2.6/site-packages/pip-1.5-py2.6.egg/pip/req.py", line 1367, in install
requirement.uninstall(auto_confirm=True)
File "/usr/lib/python2.6/site-packages/pip-1.5-py2.6.egg/pip/req.py", line 585, in uninstall
paths_to_remove.remove(auto_confirm)
File "/usr/lib/python2.6/site-packages/pip-1.5-py2.6.egg/pip/req.py", line 1768, in remove
renames(path, new_path)
File "/usr/lib/python2.6/site-packages/pip-1.5-py2.6.egg/pip/util.py", line 294, in renames
shutil.move(old, new)
File "/usr/lib/python2.6/shutil.py", line 261, in move
os.unlink(src)
OSError: [Errno 13] Permission denied: '/usr/lib/python2.6/site-packages/setuptools-0.6c11-py2.6.egg-info'
Storing debug log for failure in /home/ec2-user/.pip/pip.log
【问题讨论】:
-
@tayfun:如果是,请告诉我答案。
-
您是否通过“pip install --upgrade setuptools”升级了 setuptools?
-
这可能会有所帮助。这就是我引用的副本中推荐的内容。
-
@tayfun:请检查更新。
-
@GloryOfSuccess 你不能阻止人们投票结束作为受骗者,并用全部大写的评论说它不是受骗者。而是编辑您的问题,以阐明该问题未涵盖的与您的情况有何不同。
标签: python linux amazon-web-services amazon-ec2 lxml