how to install lxml with pypy in virtualenv

混江龙づ霸主 提交于 2020-01-06 02:45:07

问题


I am trying to use pypy in a virtualenv for better performance in running my python program. I was able to install all the required modules, except for lxml

So far, I tried

pip install lxml

Also tried

pip install --upgrade lxml

It shows the following message at the end:

Successfully installed lxml-3.4.4

However, when I start pypy prompt and try to import lxml, I get the error:

(venv)➜  pypy  pypy
Python 2.7.3 (2.2.1+dfsg-1ubuntu0.2, Dec 02 2014, 23:00:55)
[PyPy 2.2.1 with GCC 4.8.2] on linux2
Type "help", "copyright", "credits" or "license" for more information.
And now for something completely different: ``denial is rarely a good debugging
technique''
>>>> import lxml
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
ImportError: No module named lxml
>>>> from lxml import html
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
ImportError: No module named lxml

Update:

I am using ubuntu 14.04

Also, I have tried

sudo apt-get install pypy-dev

回答1:


I had a similar problem. I got it working by running sudo apt-get install python-dev libxml2 libxml2-dev libxslt-dev and then pip install --upgrade lxml



来源:https://stackoverflow.com/questions/30037435/how-to-install-lxml-with-pypy-in-virtualenv

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