possible errors in WSL when running python3 -m pip #2679
Description
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.
- ID: 23257172-281d-1069-0db2-d63d72d3d8cc
- Version Independent ID: 0810ba9a-254a-073a-8a86-a5f750fe9ae4
- Content: Web development with Python on Windows
- Content Source: hub/python/web-frameworks.md
- Product: dev-environment
- Technology: windows-python
- GitHub Login: @mattwojo
- Microsoft Alias: mattwoj