相关文章推荐
无聊的板凳  ·  Pandas在循环中向df添加行·  1 年前    · 
乐观的红豆  ·  docker es ...·  1 年前    · 
挂过科的大蒜  ·  用户对问题“TCPDI ...·  1 年前    · 
Collectives™ on Stack Overflow

Find centralized, trusted content and collaborate around the technologies you use most.

Learn more about Collectives

Teams

Q&A for work

Connect and share knowledge within a single location that is structured and easy to search.

Learn more about Teams

as written in the title and as you can see in the first image I'm trying to install pandas and I get this error each time and not just pandas but all the libraries , I know this question has been asked but none of the answers that I found helped me . I'm not using a proxy .

C:\Users\yoooo>pip install pandas

C:\Users\yoooo>pip install pandas WARNING: Retrying (Retry(total=4, connect=None, read=None, redirect=None, status=None)) after connection broken by 'ReadTimeoutError("HTTPSConnectionPool(host='pypi.org', port=443): Read timed out. (read timeout=15)")': /simple/pandas/ WARNING: Retrying (Retry(total=3, connect=None, read=None, redirect=None, status=None)) after connection broken by 'ReadTimeoutError("HTTPSConnectionPool(host='pypi.org', port=443): Read timed out. (read timeout=15)")': /simple/pandas/ WARNING: Retrying (Retry(total=2, connect=None, read=None, redirect=None, status=None)) after connection broken by 'ReadTimeoutError("HTTPSConnectionPool(host='pypi.org', port=443): Read timed out. (read timeout=15)")': /simple/pandas/ WARNING: Retrying (Retry(total=1, connect=None, read=None, redirect=None, status=None)) after connection broken by 'ReadTimeoutError("HTTPSConnectionPool(host='pypi.org', port=443): Read timed out. (read timeout=15)")': /simple/pandas/ WARNING: Retrying (Retry(total=0, connect=None, read=None, redirect=None, status=None)) after connection broken by 'ReadTimeoutError("HTTPSConnectionPool(host='pypi.org', port=443): Read timed out. (read timeout=15)")': /simple/pandas/

ERROR: Could not find a version that satisfies the requirement pandas (from versions: none)

ERROR: No matching distribution found for pandas

error

tried to ping pypi.org and got this

 C:\Users\yoooo>ping pypi.org

Pinging pypi.org [2a04:4e42::223] with 32 bytes of data:

Request timed out.

Request timed out.

Reply from 2a04:4e42::223: time=227ms

Reply from 2a04:4e42::223: time=556ms

Ping statistics for 2a04:4e42::223:

Packets: Sent = 4, Received = 2, Lost = 2 (50% loss), Approximate round trip times in milli-seconds: Minimum = 227ms, Maximum = 556ms, Average = 391ms

pip and python versions (I can't update pip obviously).

C:\Users\yoooo>python --version

Python 3.8.6

C:\Users\yoooo>pip --version

pip 20.2.1

versions

what do you think the problem is ? and if it's caused by my internet provider what should I tell them ? telling them I'm not able to install python libraries will not be understandable .

tried this and and it led to the same error eventually

C:\Users\yoooo>pip --default-timeout=1000 install pandas

WARNING: Retrying (Retry(total=4, connect=None, read=None, redirect=None, status=None)) after connection broken by 'ProtocolError('Connection aborted.', ConnectionResetError(10054, 'An existing connection was forcibly closed by the remote host', None, 10054, None))': /simple/pandas/ ...

Does this answer your question? How to solve ReadTimeoutError: HTTPSConnectionPool(host='pypi.python.org', port=443) with pip? – Abdul Aziz Barkat Jan 17, 2021 at 12:29

You need to give precedence to IPv4 over IPv6.

To do so, open CMD with administrator permissions and apply the following command:

netsh interface ipv6 set prefixpolicy ::ffff:0:0/96 46 4
                @Alex you can see my solution below "In my case, ubuntu 20.4, changing it to prefer IPv4 over IPV6, resolved the issue"
– Maoz Zadok
                Mar 17, 2022 at 10:16
pip --default-timeout=1000 install pandas

If that doesn't work, download the wheel file from here. Then change directory to where you saved it. Then run:

pip install <.whl file name>
                Pandas is a large library. You might just have a slow internet connection. Try raising the default timeout.
– DapperDuck
                Jan 17, 2021 at 12:55
                I have a speed of ~160Mbs currently and I'm using an ethernet , so I don't think it's a slow connectivity problem .
– Mohamed Abomokh
                Jan 17, 2021 at 12:58
                I'm not sure why this is happening then. I updated my answer to include details about how to install from wheel files.
– DapperDuck
                Jan 17, 2021 at 13:07

In my case, ubuntu 20.4, changing it to prefer IPv4 over IPV6, resolved the issue.

I was using strace pip install <some packages>, and noticed that IPv6 is been used (maybe there is a simple way).

this is how I change it to prefer IPv4 over IPV6: edit the file /etc/gai.conf and uncomment the line:

precedence ::ffff:0:0/96  100

restart is not required.

Thanks for contributing an answer to Stack Overflow!

  • Please be sure to answer the question. Provide details and share your research!

But avoid

  • Asking for help, clarification, or responding to other answers.
  • Making statements based on opinion; back them up with references or personal experience.

To learn more, see our tips on writing great answers.