Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

possible errors in WSL when running python3 -m pip #2679

Closed
nobodhi opened this issue Sep 2, 2020 · 6 comments
Closed

possible errors in WSL when running python3 -m pip #2679

nobodhi opened this issue Sep 2, 2020 · 6 comments
Assignees
Labels
dev-environment/prod doc-bug feedback is about something that is out of date, unclear, confusing, or broken in the article Pri2 windows-python/tech

Comments

@nobodhi
Copy link

nobodhi commented Sep 2, 2020

In this step:

python3 -m pip install flask

You may encounter an error such as this:

WARNING: Retrying (Retry(total=4, connect=None, read=None, redirect=None, status=None)) after connection broken by 'NewConnectionError('<urllib3.connection.VerifiedHTTPSConnection object at 0x7f655471da30>: Failed to establish a new connection: [Errno -3] Temporary failure in name resolution')': /simple/flask/

When researching this problem you may get led down several rabbit holes, none of which are particularly productive on WSL Ubuntu. (Warning: on WSL do not try editing resolv.conf, that file is a symbolic link and modifying it is a can of worms). Unless you are running an aftermarket firewall, the likely solution is to simply re-install pip:

sudo apt -y purge python3-pip
sudo python3 -m pip uninstall pip
sudo apt -y install python3-pip --fix-missing

H/T - microsoft/WSL#4020


Document Details

Do not edit this section. It is required for docs.microsoft.com ➟ GitHub issue linking.

@hkhmsft hkhmsft added the product-feedback Indicates that the feedback was related to the product itself. label Sep 8, 2020
@mattwojo
Copy link
Contributor

Thanks for posting this issue @josebrwn. Sorry for my slowness getting to it, but it's on my list to add this to a troubleshooting section of the docs. I'll post an update once it's in.

@mattwojo mattwojo removed the product-feedback Indicates that the feedback was related to the product itself. label Oct 29, 2020
@mattwojo
Copy link
Contributor

Thanks again for this @josebrwn - finally got it added to the FAQ. Your contributions are really appreciated. Closing - resolved with https://github.com/MicrosoftDocs/windows-uwp-pr/pull/1111

@hkhmsft hkhmsft added the doc-bug feedback is about something that is out of date, unclear, confusing, or broken in the article label Oct 30, 2020
@corneliusroemer
Copy link

I got a similar but slightly different error just now after installing conda. In my case I got Errno -2 "Name or service not known".

WARNING: Retrying (Retry(total=4, connect=None, read=None, redirect=None, status=None)) after connection broken by 'NewConnectionError('<pip._vendor.urllib3.connection.HTTPSConnection object at 0x7f81caa39bb0>: Failed to establish a new connection: [Errno -2] Name or service not known')': /simple/qiskit/

It was enough to update/upgrade the distribution (WSL Ubuntu).

@xuancong84
Copy link

I also encounter the same error as @corneliusroemer using WSL2, so pip cannot install anything, totally broken:

Requirement already satisfied: pip in /home/ubuntu/miniconda3/lib/python3.9/site-packages (21.2.4)
WARNING: Retrying (Retry(total=4, connect=None, read=None, redirect=None, status=None)) after connection broken by 'NewConnectionError('<pip._vendor.urllib3.connection.HTTPSConnection object at 0x7fbd3e3d1dc0>: Failed to establish a new connection: [Errno -2] Name or service not known')': /simple/pip/
WARNING: Retrying (Retry(total=3, connect=None, read=None, redirect=None, status=None)) after connection broken by 'NewConnectionError('<pip._vendor.urllib3.connection.HTTPSConnection object at 0x7fbd3e3d1280>: Failed to establish a new connection: [Errno -2] Name or service not known')': /simple/pip/
WARNING: Retrying (Retry(total=2, connect=None, read=None, redirect=None, status=None)) after connection broken by 'NewConnectionError('<pip._vendor.urllib3.connection.HTTPSConnection object at 0x7fbd3e3d1610>: Failed to establish a new connection: [Errno -2] Name or service not known')': /simple/pip/
WARNING: Retrying (Retry(total=1, connect=None, read=None, redirect=None, status=None)) after connection broken by 'NewConnectionError('<pip._vendor.urllib3.connection.HTTPSConnection object at 0x7fbd3e3d1430>: Failed to establish a new connection: [Errno -2] Name or service not known')': /simple/pip/
WARNING: Retrying (Retry(total=0, connect=None, read=None, redirect=None, status=None)) after connection broken by 'NewConnectionError('<pip._vendor.urllib3.connection.HTTPSConnection object at 0x7fbd3e3d1250>: Failed to establish a new connection: [Errno -2] Name or service not known')': /simple/pip/

@PortugalNeto
Copy link

Hey guys, do you have encoutered any solutions for this issue?
@xuancong84

My problem is when I use wsl and the error is as follow:

Retrying (Retry(total=4, connect=None, read=None, redirect=None, status=None)) after connection broken by 'NewConnectionError('<pip._vendor.urllib3.connection.VerifiedHTTPSConnection object at 0x7f767f07bb38>: Failed to establish a new connection: [Errno 101] Network is unreachable',)': /simple/pip/

@xuancong84
Copy link

xuancong84 commented May 26, 2022

@PortugalNeto Anaconda's python -m pip install works while Miniconda's python -m pip install does not work. So you can install your package using Anaconda first, then copy over the package folder to Miniconda.

QuinnRadich pushed a commit that referenced this issue Jun 2, 2022
* Remove Asset product tool section per request

* Work around bug in list spacing

* Another Work around bug in list spacing
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
dev-environment/prod doc-bug feedback is about something that is out of date, unclear, confusing, or broken in the article Pri2 windows-python/tech
Projects
None yet
Development

No branches or pull requests

7 participants