最近学习python,在安装scrapy时,出现一大堆 的错误,总结如下:
1.UnicodeDecodeError: 'ascii' codec can't decode byte 0xe5 in position 4: ordinal not in range
解决方案:找到C/Python27/lib/mimetypes.py
在大概250行的位置 添加如下代码:if sys.getdefaultencoding() !='gbk':
reload(sys)
sys.setdefaultencoding('gbk')
default_encoding = sys.getdefaultencoding()
2.出错cl.exe failed with exit status2解决方法(一般是在安装lxml)
解决方案:set STATICBUILD=true && pip install lxml
3.Microsoft Visual C++ 9.0 is required Unable to find vcvarsall.bat 解决办法
解决方案:下载 Microsoft Visual C++ Compiler for Python 2.7, 安装一下问题解决
下载链接:
http://www.microsoft.com/en-us/download/confirmation.aspx?id=44266
4 No module named cryptography.hazmat.bindings.openssl.binding
解决方案:python -m pip install --upgrade pip
and
pip2 install cryptography
5. 需要安装 pip install pyOpenSSL cryptography