Python安装Scrapy的问题记录(win10/Ubuntu)

win10环境下的安装

首先在命令窗口敲pip install Scrapy会有错误提示:

error:
 Microsoft Visual C++ 14.0 is required. Get it with "Microsoft Visual

这里需要安装Twisted,在http://www.lfd.uci.edu/~gohlke/pythonlibs/#twisted 下载需要的版本,然后使用 pip install 文件完整路径 安装

以上部分详细可以按照 http://www.jb51.net/article/125081.htm 的内容进行操作,

但是这里安装也会出现问题,表示这个版本不支持该平台,如果检查python版本和系统位数都没有问题,打开python检查支持的文件名:

>>> import pip
>>> print(pip.pep425tags.get_supported())
[('cp36', 'cp36m', 'win32'), ('cp36', 'none', 'win32'), ('py3', 'none', 'win32'), ('cp36', 'none', 'any'), ('cp3', 'none', 'any'), ('py36', 'none', 'any'), ('py3', 'none', 'any'), ('py35', 'none', 'any'), ('py34', 'none', 'any'), ('py33', 'none', 'any'), ('py32', 'none', 'any'), ('py31', 'none', 'any'), ('py30', 'none', 'any')]
>>> 

修改文件名为Twisted-17.5.0-cp36-none-any.whl之后安装没有问题。

Ubuntu环境下的安装

linux下简单很多,首先确保安装了pip(sudo apt install python-pip3)

然后直接使用pip安装即可:sudo pip install scrapy(可能需要更新pip版本,按提示操作即可)

猜你喜欢

转载自blog.csdn.net/u013146766/article/details/79179145