`
hyl198611
  • 浏览: 225257 次
  • 性别: Icon_minigender_1
  • 来自: 北京
社区版块
存档分类
最新评论

mac pip install lxml

阅读更多

报错如下:

cc -fno-strict-aliasing -fno-common -dynamic -g -Os -pipe -fno-common -fno-strict-aliasing -fwrapv -DENABLE_DTRACE -DMACOSX -DNDEBUG -Wall -Wstrict-prototypes -Wshorten-64-to-32 -DNDEBUG -g -fwrapv -Os -Wall -Wstrict-prototypes -DENABLE_DTRACE -Wno-error=unused-command-line-argument-hard-error-in-future -pipe -Wno-error=unused-command-line-argument-hard-error-in-future -I/usr/include/libxml2 -I/private/tmp/pip_build_root/lxml/src/lxml/includes -I/System/Library/Frameworks/Python.framework/Versions/2.7/include/python2.7 -c src/lxml/lxml.etree.c -o build/temp.macosx-10.10-intel-2.7/src/lxml/lxml.etree.o -w -flat_namespace

 

In file included from src/lxml/lxml.etree.c:239:

 

/private/tmp/pip_build_root/lxml/src/lxml/includes/etree_defs.h:14:10: fatal error: 'libxml/xmlversion.h' file not found

 

#include "libxml/xmlversion.h"

 

         ^

 

1 error generated.

 

 

error: command 'cc' failed with exit status 1

 

 

 

------------------------------

首先确认使用了 brew 安装 install libxml2 and libxslt

 

 

执行以下命令:

xcode-select --install
sudo CPATH=/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.9.sdk/usr/include/libxml2 CFLAGS=-Qunused-arguments CPPFLAGS=-Qunused-arguments pip install lxml
我的Mac为 MacOSX10.10.sdk 





分享到:
评论

相关推荐

    Python pip安装lxml出错的问题解决办法

     >>> pip install lxml C:\Users\Chen>pip install lxml Collecting lxml Using cached lxml-3.5.0.tar.gz Installing collected packages: lxml Running setup.py install for lxml ... error Complete ...

    ZhiSpider:知蛛 — 抓取知乎的问题及答案的爬虫,采用SQLite存储

    STATIC_DEPS=true sudo pip install lxml Ubuntu sudo pip install requests sudo pip install pyyaml sudo apt-get install libxml2-dev libxslt-dev python-dev sudo pip install lxml 使用 1.修改Config.yaml文件...

    LianjiaSpider

    链家 (python)爬虫 成交数据 及 在售数据 爬取开源地址:依赖包 lxml requests BeautifulSoup xlwt xlrd Bs4mac or linux :sudo pip install lxml requests BeautifulSoup xlwt xlrd Bs4windows:pip install lxml ...

    Starbucks_Japan

    如果您遇到没有提示的错误, $> easy_install pip然后重复上述pip install lxml。如果这两个权限均被拒绝,请不要忘记使用sudo。库安装完成后,应进行抓取$> python starbucks_scraping.py您所要做的就是轻按。 我只...

    python爬虫mac版本猪精原创

    python mac版爬虫 - 豆瓣电视爬虫案例 ### xpath和lxml ... - 安装:pip install lxml - 使用 ```pthon from lxml import etree element = etree.HTML("html字符串") element.xpath("") ```

    Mac-amd-info:macOS AMD kext扫描仪

    sudo pip install beautifulsoup4 lxml requests 如果您没有可用的点子: sudo easy_install pip sudo pip install beautifulsoup4 lxml requests 命令行开发人员工具 xcode-select --install 用法 开放式终端 cd...

    LabelImg用于生成PASCAL VOC格式的图片标注工具-python

    Ubuntu Linux Python 2 + Qt4 sudo apt-get install pyqt4-dev-tools sudo pip install lxml make qt4py2 python labelImg.py python labelImg.py [IMAGE_PATH] [预定义类文件] Python 3 + Qt5(推荐)sudo apt- ...

    label_images:标签图像工具

    标签图 ...sudo pip install lxml make qt4py2 python labelImg.py python labelImg.py [IMAGE_PATH] [PRE-DEFINED CLASS FILE] Python 3 + Qt5(推荐) sudo apt-get install pyqt5-dev-tools sudo pi

    LabelImg:绘制对象rect并添加一些属性

    标签图 LabelImg是图形图像注释工具。 它是用Python编写的,并将...sudo pip install lxml make qt4py2 python labelImg.py python labelImg.py [IMAGE_PATH] [PRE-DEFINED CLASS FILE] Python 3 + Qt5 sudo apt-ge

    Project3-Scrum2:Scrum Team 2 IT 4320的库存数据可视化项目

    Project3-Scrum2 Scrum Team 2 IT 4320的库存数据可视化项目 为了使Lxml,Request和Pygal正常工作,您必须执行以下操作: 'git clone ' ... **如果您使用的是Mac,则可能必须使用“ pip3”而不是“ pip”。

    CDUT_SelectCourse::check_mark: CDUT 教务处选课程序

    Linux/Mac OS 用户安装 Python3安装依赖pip install requests lxml运行python3 main.py命令行帮助help 显示本信息login 登录教务处logout 清除本地 Cookiebye 退出本程序me 显示你的个人信息bx 查看必修课xx 查看...

    unsplash-downloader:从 Unsplash 下载图片

    Unsplash 下载器 网站提供了一组图片,可供免费下载和以任何方式... 如果由于 Mac 或 Linux 机器上的lxml问题而在安装 PyQuery 时遇到问题,请尝试运行以下命令: STATIC_DEPS=true pip install pyquery 然后重试第

    mtl2osm:用于转换来自蒙特利尔市的开放数据以导入 OpenStreetMap 的脚本

    OpenStreetMap 的脚本安装(Mac OS X下预备步骤:安装VirtualBox和Vagrant,让自己成为“chef/debian-7.6”虚拟机) 安装 Debian 依赖项: $ sudo apt-get install libgdal-dev python-dev python-lxml ...

Global site tag (gtag.js) - Google Analytics