CERT_NONE is not defined
来源:互联网 发布:充值软件怎么赚钱 编辑:程序博客网 时间:2024/04/25 03:00
本人在Redhat上遇到了这个问题,后来解决办法是:yum install openssl098e.x86_64;然后就OK了
下面是转的别人的办法:
緣起
突然想學習下requests,不過在安裝requests 時卻報了這個錯誤:“NameError: name 'CERT_NONE' is not defined”。
在Googole上搜索之後才知道,requests需要 ssl 的支持,源碼編譯安裝的 Python若需要提供 ssl 的支持,在編譯前需要系統已安裝了 libssl-dev
庫。
而我使用的是通過 Pythonz編譯安裝的Python,經驗證是未提供 ssl 的支持。(驗證方法見下文。)
解決方法
知道原因後就好辦了,解決方法如下:
- 在系統中安裝必要的庫:
sudo apt-get install libssl-dev
; - 刪除通過Pythonz安裝的 Python:
pythonz uninstall 2.7.3
; (詳細的安裝Python方法見上一篇博文) - 重新編譯安裝Python:
pythonz install 2.7.3
; - 驗證 ssl :
python -c "import ssl"
;(若未報錯即已支持;反之,請繼續Google,我也愛莫能助了。) - 安裝 requests:
pip install requests
。
希望對你有所幫助,特此分享之。
本文的系統環境爲 Utubut 12.04 。
0 0
- CERT_NONE is not defined
- Ext is not defined
- $ is not defined error
- $ is not defined error
- dojo is not defined!
- $ is not defined
- $ is not defined 问题
- Ext is not defined
- Ext is not defined
- $ is not defined
- jQuery is not defined
- ReferenceError: $ is not defined
- Ext is not defined
- $ is not defined
- d3 is not defined
- Ext is not defined
- $ is not defined
- $ is not defined
- Pro Android学习笔记(一零九):2D动画(4):view的Matrix
- Fragment中ViewPager嵌套Fragment引起的问题
- HDOJ 题目1042 N!(大数)
- hdu1017 A Mathematical Curiosity
- 三种iOS多线程实现的方法
- CERT_NONE is not defined
- Android 异步链式调用设计
- 简化浏览器地址栏访问路径
- 80后女高管弃15万年薪卖水果 两月营业额近20万
- Redis的分片、预分片技术总结
- 微信公众平台 绑定微信用户OpenID与第三方业务账号
- linux lamp搭建以及 web文件权限设置
- linux找不到库文件
- How to serialize/unserialize type struct in GO