简体   繁体   English

ImportError:Mac上没有名为lxml的模块

[英]ImportError: No module named lxml on Mac

I am having a problem running a Python script and it is showing this message: 我在运行Python脚本时遇到问题并显示此消息:

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. 我想我必须安装一些名为lxml但我真的是Python的新手,我真的没有太多的想法。

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. 我想我在我的Mac上安装了两个版本的Python,这是我在其他主题中读到的,但我不确定。

How can I solve this issue? 我该如何解决这个问题?

Python Version: 2.7.6 Python版本:2.7.6

Mac OS X 10.9.2 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 : 我最近使用pip安装,但在它完成之前,我需要按照这篇文章中的说明发出以下命令:

xcode-select --install

If you don't have pip , you can get it from easy_install . 如果您没有pip ,可以从easy_install获取。 If I recall correctly, the full sequence of commands should be something like this (assuming you already have gotten Xcode): 如果我没记错的话,完整的命令序列应该是这样的(假设你已经得到了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 您的问题的答案在这里: http//lxml.de/installation.html#installation

Go to the MacOS section and follow the instructions :-) 转到MacOS部分并按照说明操作:-)

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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