简体   繁体   中英

ImportError: No module named lxml on Mac

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

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

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

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

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM