Pip is already installed: but I am getting no module named lxml

好久不见. 提交于 2019-12-08 13:04:01

问题


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

回答1:


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



来源:https://stackoverflow.com/questions/22356580/pip-is-already-installed-but-i-am-getting-no-module-named-lxml

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!