Skip to content
Advertisement

Installing ‘lxml’ in Amazon EC2

I am having trouble installing lxml in Amazon EC2. I am having a Linux instance. I entered the following command.

sudo pip install lxml

Right now, it is not working. It just generate the following error.

[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'

What is wrong here? How can I install this?

Update

I used pip install --upgrade setuptools. Now I am getting the below.

[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

Advertisement

Answer

You are upgrading system wide library. Package manager will need more access rights to do so.

Use:

sudo pip install --upgrade setuptools
User contributions licensed under: CC BY-SA
1 People found this is helpful
Advertisement