ImportError: No module named lxml on Mac

匿名 (未验证) 提交于 2019-12-03 08:59:04

问题:

I am having a problem running a Python script and it is showing this message:

ImportError: No module named lxml 

I suppose I have to install somewhat called lxml but I am really newbie to Python and I don't really have too much idea on that.

I think I have two versions of Python installed on my Mac from what I have read in other threads, but I am not sure.

How can I solve this issue?

Python Version: 2.7.6

Mac OS X 10.9.2

Thanks

回答1:

I've installed recently using pip, but before it would all work, I needed to issue the following command as instructed in this post:

xcode-select --install 

If you don't have pip, you can get it from easy_install. If I recall correctly, the full sequence of commands should be something like this (assuming you already have gotten Xcode):

sudo easy_install pip xcode-select --install sudo pip install lxml 


回答2:

The answer of your question is here: http://lxml.de/installation.html#installation

Go to the MacOS section and follow the instructions :-)



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