0

I have installed lxml with pip. But when I run a script that uses lxml, I get "no module named lxml." Why might this be? How do I fix it?

(venv)prompt$ sudo pip install lxml
Requirement already satisfied (use --upgrade to upgrade): lxml in /usr/local/lib/python2.7/dist-packages
Cleaning up...
(venv)prompt$ python scripts/pyftp.py 
Traceback (most recent call last):
  File "scripts/pyftp.py", line 5, in <module>
    from lxml import etree
ImportError: No module named lxml
rypel
  • 4,686
  • 2
  • 25
  • 36
bernie2436
  • 22,841
  • 49
  • 151
  • 244

1 Answers1

2

It looks like you are in a virtualenv. You probably do not want to be root when installing new packages.

Ben
  • 2,422
  • 2
  • 16
  • 23