Installation error, never succeeded, hope to get help

Server Geographical location:Asia/HongKong
ServerOS: Centos1503\1810\1908\1911
Tried most centos systems Centos7-8
Tried various python pip yum Replacement of source and system update.All made mistakes and never succeeded

Hope to get help, at least once I can experience cyberpanel

WARNING: Running pip install with root privileges is generally not a good idea. Try pip3.6 install --user instead.
Collecting virtualenv
Downloading https://files.pythonhosted.org/packages/05/f1/2e07e8ca50e047b9cc9ad56cf4291f4e041fa73207d000a095fe478abf84/virtualenv-16.7.9-py2.p y3-none-any.whl (3.4MB)
Exception:
Traceback (most recent call last):
File β€œ/usr/lib/python3.6/site-packages/pip/_vendor/urllib3/response.py”, line 302, in _error_catcher
yield
File β€œ/usr/lib/python3.6/site-packages/pip/_vendor/urllib3/response.py”, line 384, in read
data = self._fp.read(amt)
File β€œ/usr/lib/python3.6/site-packages/pip/_vendor/cachecontrol/filewrapper.py”, line 60, in read
data = self.__fp.read(amt)
File β€œ/usr/lib64/python3.6/http/client.py”, line 459, in read
n = self.readinto(b)
File β€œ/usr/lib64/python3.6/http/client.py”, line 503, in readinto
n = self.fp.readinto(b)
File β€œ/usr/lib64/python3.6/socket.py”, line 586, in readinto
return self._sock.recv_into(b)
File β€œ/usr/lib64/python3.6/ssl.py”, line 968, in recv_into
return self.read(nbytes, buffer)
File β€œ/usr/lib64/python3.6/ssl.py”, line 830, in read
return self._sslobj.read(len, buffer)
File β€œ/usr/lib64/python3.6/ssl.py”, line 587, in read
v = self._sslobj.read(len, buffer)
socket.timeout: The read operation timed out

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File β€œ/usr/lib/python3.6/site-packages/pip/basecommand.py”, line 215, in main
status = self.run(options, args)
File β€œ/usr/lib/python3.6/site-packages/pip/commands/install.py”, line 346, in run
requirement_set.prepare_files(finder)
File β€œ/usr/lib/python3.6/site-packages/pip/req/req_set.py”, line 381, in prepare_files
ignore_dependencies=self.ignore_dependencies))
File β€œ/usr/lib/python3.6/site-packages/pip/req/req_set.py”, line 623, in _prepare_file
session=self.session, hashes=hashes)
File β€œ/usr/lib/python3.6/site-packages/pip/download.py”, line 821, in unpack_url
hashes=hashes
File β€œ/usr/lib/python3.6/site-packages/pip/download.py”, line 659, in unpack_http_url
hashes)
File β€œ/usr/lib/python3.6/site-packages/pip/download.py”, line 882, in _download_http_url
_download_url(resp, link, content_file, hashes)
File β€œ/usr/lib/python3.6/site-packages/pip/download.py”, line 603, in _download_url
hashes.check_against_chunks(downloaded_chunks)
File β€œ/usr/lib/python3.6/site-packages/pip/utils/hashes.py”, line 46, in check_against_chunks
for chunk in chunks:
File β€œ/usr/lib/python3.6/site-packages/pip/download.py”, line 571, in written_chunks
for chunk in chunks:
File β€œ/usr/lib/python3.6/site-packages/pip/utils/ui.py”, line 139, in iter
for x in it:
File β€œ/usr/lib/python3.6/site-packages/pip/download.py”, line 560, in resp_read
decode_content=False):
File β€œ/usr/lib/python3.6/site-packages/pip/_vendor/urllib3/response.py”, line 436, in stream
data = self.read(amt=amt, decode_content=decode_content)
File β€œ/usr/lib/python3.6/site-packages/pip/_vendor/urllib3/response.py”, line 401, in read
raise IncompleteRead(self._fp_bytes_read, self.length_remaining)
File β€œ/usr/lib64/python3.6/contextlib.py”, line 99, in exit
self.gen.throw(type, value, traceback)
File β€œ/usr/lib/python3.6/site-packages/pip/_vendor/urllib3/response.py”, line 307, in _error_catcher
raise ReadTimeoutError(self._pool, None, β€˜Read timed out.’)
pip._vendor.urllib3.exceptions.ReadTimeoutError: HTTPSConnectionPool(host=β€˜files.pythonhosted.org’, port=443): Read timed out.

is your VPS using IPv6?

ip a
should should show if you are. If you are you might try temporarily disabling it via sysctl and running the installer again. Once installed should be able to enable it again.

I believe some of the installation urls are not setup for ipv6 and cause weird issues like this. Happened to me on Ubuntu earlier.

Ended up doing this fixed it for me
root@ols:~# nano /etc/sysctl.d/99-sysctl.conf
root@ols:~# sysctl -p
net.ipv6.conf.all.disable_ipv6 = 1
net.ipv6.conf.default.disable_ipv6 = 1
net.ipv6.conf.lo.disable_ipv6 = 1
root@ols:~#

1 Like

Type your comment> @whattheserver said:

is your VPS using IPv6?

ip a
should should show if you are. If you are you might try temporarily disabling it via sysctl and running the installer again. Once installed should be able to enable it again.

I believe some of the installation urls are not setup for ipv6 and cause weird issues like this. Happened to me on Ubuntu earlier.

Ended up doing this fixed it for me
root@ols:~# nano /etc/sysctl.d/99-sysctl.conf
root@ols:~# sysctl -p
net.ipv6.conf.all.disable_ipv6 = 1
net.ipv6.conf.default.disable_ipv6 = 1
net.ipv6.conf.lo.disable_ipv6 = 1
root@ols:~#

Thank you for your help, I closed my ipv6 and confirmed again that ipv6 was closed. The installation result is the same as the above error message

According to the idea given by @whattheserver, I closed ipv6 and customized the ~ / .pip / pip.conf specification.
Install again and it works. Thanks again