python之报错的解决(持续总结)
2015-10-26 11:54
579 查看
1 UnicodeEncodeError: 'ascii' codec can't encode characters in position 0-3: ordinal not in range(128)
今天在部署代码的时候,报了一个异常,经过百度后得知是 字符集问题,处理办法如下:
在文件前加两句话:
本文出自 “一个奋斗的小运维” 博客,请务必保留此出处http://yucanghai.blog.51cto.com/5260262/1706267
今天在部署代码的时候,报了一个异常,经过百度后得知是 字符集问题,处理办法如下:
在文件前加两句话:
reload(sys) sys.setdefaultencoding("utf-8")2 使用requests 模块的时候报错:
C:\Python27\lib\site-packages\requests\packages\urllib3\util\ssl_.py:100: InsecurePlatformWarning: A true SSLContext object is not available. This prevents urllib3 from configuri ng SSL appropriately and may cause certain SSL connections to fail. For more information, see https://urllib3.readthedocs.org/en/latest/security.html#insecureplatformwarning. InsecurePlatformWarning是由于缺少一些ssl的支持包。解决办法:
pip install requests[security]出处:http://stackoverflow.com/questions/29134512/insecureplatformwarning-a-true-sslcontext-object-is-not-available-this-prevent
本文出自 “一个奋斗的小运维” 博客,请务必保留此出处http://yucanghai.blog.51cto.com/5260262/1706267
相关文章推荐
- Python基础(十)正则表达式
- Python 深入理解yield
- tornado 学习笔记2 Python web主流框架
- tkinter 学习笔记
- python的一些日期处理方法(工具)
- python集合
- python培训Day1 随笔
- 快速入门:十分钟学会Python(转)
- Python学习笔记5
- Python入门教程 超详细1小时学会Python(转)
- python中文显示报错
- Python Cookie操作实战---requests&selenium&urllib2
- Ubuntu下一个python的BeautifulSoup和rsa安装方法---信息检索project2部分:微博爬行要求python包裹
- 笨办法学python的笔记之八(ex42 class类)
- (3)python运算符
- python 小记
- Python3学习笔记02
- Python3 socket编程,并与多线程实现最简单的聊天工具之一
- python学习记录之_1025
- 深入讲解Python中的迭代器和生成器