Error Messages:
Traceback (most recent call last): File "/usr/local/python3/lib/python3.7/site-packages/ddt.py", line 192, in wrapper return func(self, *args, **kwargs) File "/usr/hxy/auto-test/interface/test_start.py", line 49, in test result = RequestsHandle().httpRequest(method, reparam.uri, data=reparam.data, headers=reparam.headers) File "/usr/hxy/auto-test/common/request_handle.py", line 32, in httpRequest headers=headers, verify=False, proxies=proxies) File "/usr/local/python3/lib/python3.7/site-packages/requests/sessions.py", line 542, in request resp = self.send(prep, **send_kwargs) File "/usr/local/python3/lib/python3.7/site-packages/requests/sessions.py", line 655, in send r = adapter.send(request, **kwargs) File "/usr/local/python3/lib/python3.7/site-packages/requests/adapters.py", line 516, in send raise ConnectionError(e, request=request) requests.exceptions.ConnectionError: HTTPSConnectionPool(host='sync-test.helianhealth.com', port=443): Max retries exceeded with url: /sync-channel/channel/admin/hsp/template/isOnline (Caused by NewConnectionError('<urllib3.connection.HTTPSConnection object at 0x7fd369b643c8>: Failed to establish a new connection: [Errno -2] Name or service not known'))
I don’t get the error locally, but when I deploy the project on a Linux server, I get the error.
This is because there are other technicians using the server besides me, and the version of the request is outdated.
Solution: Update requests with the command: pip install -U requests
If the following error occurs.
ERROR: Cannot uninstall ‘requests’. It is a distutils installed project and thus we cannot accurately determine which files belong to it which would lead to only a partial uninstall.
After installing a package with distutils, you need to uninstall it with distutils. Unfortunately distutils does not contain an uninstall command, so “uninstall using distutils” means that you have to remove the package manually.
cd /usr/lib/python2.7/site-packages/
mkdir /opt/pylib_backup/
mv requests* /opt/pylib_backup/
PIP list sees that the requests package has been unloaded
[root@bareos_server site-packages]# pip list |grep request
DEPRECATION: Python 2.7 reached the end of its life on January 1st, 2020. Please upgrade your Python as Python 2.7 is no longer maintained. pip 21.0 will drop support for Python 2.7 in January 2021. More details about Python 2 support in pip can be found at https://pip.pypa.io/en/latest/development/release-process/#python-2-support pip 21.0 will remove support for this functionality.
[root@bareos_server site-packages]#
Read More:
- Failed to establish a new connection: [winerror 10048] in the requests thread pool, the interface is called circularly to get the datagram error
- Python requests Error: ConnectionError: (‘Connection aborted.‘, error(104, ‘Connection reset by peer‘))
- [Solved] Python requests ConnectionError Error: connection aborted BadStatusLine
- Python PIP TypeError: expected str, bytes or os.PathLike object, not int
- Failed to Create New Environment Error: Collecting package metadata (current_repodata.json): failed.
- When sending HTTP request, python encountered: error 54, ‘connection reset by peer’ solution
- Invalid python sd, Fatal Python error: init_fs_encoding: failed to get the Python cod [How to Solve]
- Jupyter notebook Failed to Switch to the Virual Environment: DLL load failed python.exe could not find the entry
- [Solved] Python Error: An attempt has been made to start a new process before the current process has finished …
- [Solved] pycharm Import New Project Error: cannot set up a python sdk
- [Solved] python-sutime Error: the JSON object must be str, bytes or bytearray, not ‘java.lang.String‘
- Chromdriver Install error: File “C:\python37\lib\site-packages\selenium\webdriver\common\service.py”, line 76, in start stdin=PIPE) File…
- [Solved] gyp verb `which` failed Error: not found: python2
- [Solved] bert_as_service startup error: Tensorflow 2.1.0 is not tested!
- How to Solve Python WARNING: Ignoring invalid distribution -ip (e:\python\python_dowmload\lib\site-packages)
- Python: How to Delete Empty Files or Folders in the Directory
- [Solved] torchvision Error: UserWarning: Failed to load image Python extension: Could not find module
- Importerror: DLL load failed: unable to find the specified module in Python
- How to Solve Python Importerror: DLL load failed: unable to find the specified program using tensorflow