我正在尝试安装 Python 的 Scrapy 模块。我正在使用命令:
pip install Scrapy
但我收到以下错误:
Command "/Library/Frameworks/Python.framework/Versions/2.7/Resources/Python.app/Contents/MacOS/Python -c "import setuptools, tokenize;__file__='/private/var/folders/b4/nrmj5jf105lcv1_kf1yk9gh40000gn/T/pip-build-aNQoXA/lxml/setup.py';exec(compile(getattr(tokenize, 'open', open)(__file__).read().replace('\r\n', '\n'), __file__, 'exec'))" install --record /var/folders/b4/nrmj5jf105lcv1_kf1yk9gh40000gn/T/pip-B_akAd-record/install-record.txt --single-version-externally-managed --compile" failed with error code 1 in /private/var/folders/b4/nrmj5jf105lcv1_kf1yk9gh40000gn/T/pip-build-aNQoXA/lxml
我对此做了一些研究,并尝试了几种不同的解决方案here and here但无济于事。
您可以通过 pipwheel 安装它。
从这里下载轮包。Scrapy
然后安装
pip install wheel # to install support for wheel files.
pip install Scrapy‑1.0.3‑py2‑none‑any.whl # to install the wheel.
编辑:如果在 ubuntu 或其他基于 debian 的操作系统上:
try:
sudo apt-get install python-dev
sudo apt-get install libxml2-dev libxslt1-dev
然后再次尝试安装scrapy。
在 Mac OSX 上:
从以下位置安装brew包管理器:Brew
然后尝试使用brew install package_name
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)