gpt4 book ai didi

python - 在 Amazon EC2 中安装 'lxml'

转载 作者:塔克拉玛干 更新时间:2023-11-03 00:21:17 25 4
gpt4 key购买 nike

我在 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

最佳答案

您正在升级系统范围的库。包管理器将需要更多访问权限才能执行此操作。

使用:

sudo pip install --upgrade setuptools

关于python - 在 Amazon EC2 中安装 'lxml',我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/21205617/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com