Ubuntu pip install Scrapy

Ubuntu pip install Scrapy

问题起源

sudo pip install -i https://pypi.tuna.tsinghua.edu.cn/simple scrapy 
Failed building wheel for Twisted Running setup.py clean for Twisted Running setup.py bdist_wheel
hyperlink 18.0.0 has requirement idna>=2.5, but you'll have idna 2.1 which is incompatible.
pyasn1-modules 0.2.1 has requirement pyasn1<0.5.0,>=0.4.1, but you‘ll have pyasn1 0.1.7 which is incompatible.

在这里插入图片描述
很遗憾,报了两个错误导致安装失败。

问题解决

1 升级idna

sudo pip install -i https://pypi.tuna.tsinghua.edu.cn/simple -U idna 

2 安装pyasn1
不能使用pip install 进行安装
Step1:官网下载源码
https://pypi.org/project/pyasn1/#files
在这里插入图片描述
Step2:下载后,解压,进入根目录,进行安装

python setup.py build
python setup.py install

Step3: 继续安装Scrapy

sudo pip install -i https://pypi.tuna.tsinghua.edu.cn/simple scrapy 

在这里插入图片描述
Step4: import Scrapy

fong@fong:~$ python
Python 3.5.2 |Anaconda 4.2.0 (64-bit)| (default, Jul  2 2016, 17:53:06) 
[GCC 4.4.7 20120313 (Red Hat 4.4.7-1)] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import scrapy
>>> 

OK,You’re done!

  • 1
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值