在Pycharm中导入包的时候,会存在报错问题:
如下
解决InsecureRequestWarning警告
不要使用verify=False
或者requests.packages.urllib3.disable_warnings()
不要忽视警告
尝试过这几种:
在语句前增加
正确的做法
参考
https://urllib3.readthedocs.io/en/latest/advanced-usage.html#ssl-warnings
https://urllib3.readthedocs.io/en/latest/user-guide.html#ssl
Certificate verification
It is highly recommended to always use SSL certificate verification.By default, urllib3 does not verify HTTPS requests.
In order to enable verification you will need a set of root certificates. The easiestand most reliable method is to use thecertifi package which provides Mozilla’s root certificate bundle:
安装几个包
我这机器同时安装了Python2 和 Python3 ,可以采取一下方式安装:
D:\CODE\WORK_TEST\YHCode\PreEnv>py -2 "C:\Python27\Scripts\pip.exe" install certifi
D:\CODE\WORK_TEST\YHCode\PreEnv>py -2 "C:\Python27\Scripts\pip.exe" install cryptography
D:\CODE\WORK_TEST\YHCode\PreEnv>py -2 "C:\Python27\Scripts\pip.exe" install pyOpenSSL
安装完之后,保存
待续
赠人玫瑰
手留余香
我们曾如此渴望命运的波澜,到最后才发现:人生最曼妙的风景,竟是内心的淡定与从容……我们曾如此期盼外界的认可,到最后才知道:世界是自己的,与他人毫无关系!-杨绛先生