gpt4 book ai didi

python - 为什么我安装不了python-Scrapy?

转载 作者:太空宇宙 更新时间:2023-11-04 12:17:42 26 4
gpt4 key购买 nike

我是 Vagrant 的新手,有一个 trusty64 盒子。我这样做:

sudo apt-get install -y python-pip
sudo pip install --upgrade setuptools

Then this happens.

Traceback (most recent call last):
File "/usr/local/bin/scrapy", line 7, in <module>
from scrapy.cmdline import execute
File "/usr/local/lib/python2.7/dist-packages/scrapy/__init__.py", line 34, in <module>
from scrapy.spiders import Spider
File "/usr/local/lib/python2.7/dist-packages/scrapy/spiders/__init__.py", line 10, in <module>
from scrapy.http import Request
File "/usr/local/lib/python2.7/dist-packages/scrapy/http/__init__.py", line 11, in <module>
from scrapy.http.request.form import FormRequest
File "/usr/local/lib/python2.7/dist-packages/scrapy/http/request/form.py", line 11, in <module>
import lxml.html
ImportError: No module named lxml.html`

我到底要在这里做什么?首先,我尝试通过 pip3 安装,但后来读到 Twisted 在 2 中。我该如何正确安装?

更新:::@Paula:所以我用

销毁并初始化了它
sudo apt-get install -y python-dev libxml2-dev libxslt1-dev zlib1g-dev python-pip
sudo pip install --upgrade setuptools
sudo pip install Scrapy

在安装 SCRAPY 时,我不止一次打印了这个:

x86_64-linux-gnu-gcc: internal compiler error: Killed (program cc1)
Please submit a full bug report,
with preprocessed source if appropriate.
See <file:///usr/share/doc/gcc-4.8/README.Bugs> for instructions.
Compile failed: command 'x86_64-linux-gnu-gcc' failed with exit status 4

那怎么样?

最佳答案

您需要先运行它。

sudo apt-get install python-dev libxml2-dev libxslt1-dev zlib1g-dev

正如@Cfreak 所说,您有未满足的库依赖项。

关于python - 为什么我安装不了python-Scrapy?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/46960932/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com