Why can’t you stop buying 618?From the technical dimension to explore>>>
Today, to run a python script in a new environment, we encountered the following error:
/usr/lib/python2.7/site-packages/urllib3/util/ssl_. py:160: InsecurePlatformWarning: A true SSLContext object is not available. This prevents urllib3 from configuring SSL appropriately and may cause certain SSL connections to fail. You can upgrade to a new……
The error report is related to the security policy. I searched online because of the python Version (using python2.7.5). The solution is to either upgrade the python version or install requests
Based on the principle of minimum influence, it is decided to adopt the latter as follows:
pip install requests[security]
After the installation is completed, run the python script again, and the same error is reported. I tried again
PIP install pyopenssl NDG httpclient pyasn1 (equivalent to installing requests)
After the installation is completed, rerun the python script and report the same error. I think of a common trick upgrade
pip install –upgrade requests[security]
After the installation is completed, run the python script again. As expected, no longer report the error of insure platform warning
Digression: there is no mistake in insure platform warning, but another mistake, cryptographicdecrecation warning, has been reported. The details are as follows:
/usr/lib64/python2.7/site-packages/cryptography/hazmat/primitives/constant_ time.py:26: CryptographyDeprecationWarning: Support for your Python version is deprecated. The next version of cryptography will remove support. Please upgrade to a 2.7.x release that supports hmac.compare_ digest as soon as possible.
utils.DeprecatedIn23
Remind to upgrade the python version, but at this time the script does not involve security, it can be executed normally
Similar Posts:
- Pycharm cannot import the third-party library no module named urllib3
- Python 2.7 and 3.4 requests Error: No module named ‘zlib’
- An error occurs when using PIP install XX command
- Mac version PIP install — upgrade PIP update version error
- [Solved] ValueError: check_hostname requires server_hostname
- Python pip install three-party library unsuccessful error: WARNING: You are using pip version 20.2.3; however, version 20.2.4 is available
- Bpython ImportError: No module named _curses [How to Solve]
- [Solved] Windows installation uwsgi error: AttributeError: module’os’ has no attribute’uname’
- [Solved] No module named extern.six.moves
- Python.exe Error: No module named pip.__main__; ‘pip’ is a package and cannot be directly executed