windows10系统中安装python3.x+scrapy教程 官网下载就好, http://www.python.org/downloads/release/python-352/ 用installer下载比较方便,它直接把环境变量都帮你配了。 当然也可以在本站下载 //www.zwyuanma.com/softs/416037.html 升级pip 安装好之后在cmd里执行 python -m pip install -upgrade pip 把pip提到最新版本 下载lxml lxml是解析网页用的,scrapy依赖于它,它是一个第三方的库,这里推荐一个python第三方库的网站 http://www.lfd.uci.edu/~gohlke/pythonlibs/ ,里边都是编译好的,windows下python使用者的福利。 Ctrl+F定位一下lxml 注意:打开网址后ctrl+F,搜索LXML,选择对应版本,一般是win32,而不选win_arm64,即使电脑是win64 下载好之后,cmd进入下载目录,直接用pip安装 pip install lxml-3.6.4-cp35-cp35m-win_32.whl 安装scrapy pip安装最方便 pip install scrapy 查看版本 scrapy version 输出应该是Scrapy 1.2.1,也是官网的最新版本。 可能遇到的问题 以下内容汇总了csdn和stackoverflow部分内容 1.Python error: Unable to find vcvarsall.bat 安装MinGW(实测) 1、下载安装MinGW,下载地址为:点击打开链接 2、在MinGW的安装目录下找到bin文件夹,找到mingw32-make.exe,复制一份更名为make.exe 3、把MinGW的路径添加到环境变量path中,比如我把MinGW安装到D:\MinGW\中,就把D:\MinGW\bin添加到path中; 4、在\distutils(需要在python安装目录下ctrl+f一下distutils)增加文件distutils.cfg,在文件里输入 [build] compiler=mingw32 保存; 2、error: command‘gcc'failed: No such file or directory 解决方案是将D:\MinGW\lib再添加到PATH中。 3、ValueError: Unknown MS Compiler version 1900 Cygwinccompiler.py中 get_msvcr()函数 在 elif msc_ver == '1600': # VS2010 / MSVC 10.0 return ['msvcr100'] 后面,添加以下内容 elif msc_ver == '1700': # Visual Studio 2012 / Visual C++ 11.0 return ['msvcr110'] elif msc_ver == '1800': # Visual Studio 2013 / Visual C++ 12.0 return ['msvcr120'] elif msc_ver == '1900': # Visual Studio 2015 / Visual C++ 14.0 # "msvcr140.dll no longer exists" http://blogs.msdn.com/b/vcblog/archive/2014/06/03/visual-studio-14-ctp.aspx return ['vcruntime140'] 然后将python3.5文件夹下的vcruntime140.dll复制到D:\MinGW\mingw32\lib下 4、TypeError: unorderable types: NoneType() >= str() 重启一下试试 5、error: The 'pyasn1' distribution was not found and is required by service-identity 在运行一下setup.py试试 以上就是本文的全部内容了,希望对大家学习python能够有所帮助。