Closed
Description
Please fill out the below information:
-
Your Windows build number:
10.0.17763.475
/ WSL Ubuntu18.04.2
-
What you're doing and what's happening: Type
sudo pip3 install [package]
-
What's wrong / what should be happening instead:
Following error message comes out when trying to install packages via pip.
Collecting [package]
Retrying (Retry(total=4, connect=None, read=None, redirect=None, status=None)) after connection broken by 'ProtocolError('Connection aborted.', OSError(0, 'Error'))': /simple/[package]/
Retrying (Retry(total=3, connect=None, read=None, redirect=None, status=None)) after connection broken by 'ProtocolError('Connection aborted.', OSError(0, 'Error'))': /simple/[package]/
Retrying (Retry(total=2, connect=None, read=None, redirect=None, status=None)) after connection broken by 'ProtocolError('Connection aborted.', OSError(0, 'Error'))': /simple/[package]/
Retrying (Retry(total=1, connect=None, read=None, redirect=None, status=None)) after connection broken by 'ProtocolError('Connection aborted.', OSError(0, 'Error'))': /simple/[package]/
Retrying (Retry(total=0, connect=None, read=None, redirect=None, status=None)) after connection broken by 'ProtocolError('Connection aborted.', OSError(0, 'Error'))': /simple/[package]/
Could not find a version that satisfies the requirement flask-restful (from versions: )
No matching distribution found for [package]
None of these solutions work.
- Re-install pip
- Re-install WSL
- sudo pip3 install [package]
- pip3 install [package] with root account
- sudo -H pip3 install [package]
- pip install --user [package]
These commands works normally.
- python -V (3.6)
- pip3 --version (9.0.1)
Activity
Biswa96 commentedon May 5, 2019on May 5, 2019
Allow python in Windows Firewall. Link https://docs.microsoft.com/en-us/windows/wsl/troubleshooting
hwooo commentedon May 6, 2019on May 6, 2019
@Biswa96 How do I allow WSL Python in Windows Firewall? Is it possible to access WSL file from Windows?
Biswa96 commentedon May 6, 2019on May 6, 2019
Allow this path in Windows Firewall:
The path may vary in Ubuntu versions from Windows Store. Explanation here: https://superuser.com/a/1325042/726810
Also check the
/etc/resolv.conf
file if any DNS server is present. If not then try to add, for example,echo nameserver 1.1.1.1 > /etc/resolv.conf
(yes, by overwriting).matbrgz commentedon May 6, 2019on May 6, 2019
This could work
hwooo commentedon May 6, 2019on May 6, 2019
@Biswa96 I can't configure the path.

hwooo commentedon May 6, 2019on May 6, 2019
@MatheusRV
pip install --upgrade pip
gives me same error message 😢Biswa96 commentedon May 6, 2019on May 6, 2019
Oh... Change the
username
to your user name in your PChwooo commentedon May 6, 2019on May 6, 2019
That's my mistake...But result is same.
hwooo commentedon May 13, 2019on May 13, 2019
The cause was my Kaspersky app. If I turn off it, everything works well. I've raised this issue to Kaspersky.
selvaprakash commentedon Aug 23, 2020on Aug 23, 2020
This worked for me.
sudo apt-get update
sudo apt-get upgrade
sudo apt install python3-pip
tuxdinosaur commentedon Sep 20, 2020on Sep 20, 2020
Thanks, this worked for me
42 remaining items
olvez commentedon Feb 24, 2023on Feb 24, 2023
No matter how many times I restart WSL, Windows automatically changes its name server and assign by itself.
So I change little bit as Belows,
in Windows Security > Firewall & Network Protection
In Public & private network turn off this 👇🏻
Block all incoming connections, including those in the list of allowed apps.
Restart WSL and its work like charm
Env :-
Win10
WSL2 / ubuntu 22.04
rraadd88 commentedon Mar 11, 2023on Mar 11, 2023
Within conda environment, I get this error when I use pip for the first time.
To fix it
conda install matplotlib
Env:
Win11 WSL2 / ubuntu 22.04
Firewall and proxy: off
Twetler commentedon Mar 31, 2023on Mar 31, 2023
This has solved my ERROR: Could not install packages due to an OSError when trying to pip install in WSL2
sageil commentedon Jun 1, 2023on Jun 1, 2023
I am using Python3.10 and this worked for me.
curl -sS https://bootstrap.pypa.io/get-pip.py | python3.10
Chances are you will have issues with pipenv installation, to resolve those, if they occur, use
python3 -m pip install pipenv
dstkibrom commentedon Jun 27, 2023on Jun 27, 2023
I have been having this problem and did add all my proxy settings to /etc/environment and name resolutions to /etc/resolve.conf. But that was not enough for pip to work. But exporting the https_proxy in the terminal did the magic. I am not sure why this worked though.
subhojeet-chowdhury commentedon Jul 8, 2023on Jul 8, 2023
Thankx a lot brother.
ikitcheng commentedon Jul 20, 2023on Jul 20, 2023
Hi, for me, the thing that fixed it was disconnecting my VPN connection and just connecting to wifi directly.
The-xploit commentedon Sep 18, 2023on Sep 18, 2023
I got error in upgrading pip and I can't install any pip packages. I remove it and re installed it but it saying error. Please tell me any Solutions
josephj1o4e1 commentedon Jan 19, 2024on Jan 19, 2024
This saved me!
"2:20pm. Done with the bath, breakfast and chores. Also I had my fun …
craigloewen-msft commentedon Nov 6, 2024on Nov 6, 2024
Hey folks this issue is stale so we're closing it for our bookkeeping. It looks like there are already good answers here, if you're still seeing this please reopen a new issue for us to properly triage it! Thank you!