-
Notifications
You must be signed in to change notification settings - Fork 859
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
Unable to install Python packages in WSL due to connection issues #12461
Comments
Logs are required for review from WSL teamIf this a feature request, please reply with '/feature'. If this is a question, reply with '/question'. How to collect WSL logsDownload and execute collect-wsl-logs.ps1 in an administrative powershell prompt:
The script will output the path of the log file once done. If this is a networking issue, please use collect-networking-logs.ps1, following the instructions here Once completed please upload the output files to this Github issue. Click here for more info on logging View similar issuesPlease view the issues below to see if they solve your problem, and if the issue describes your problem please consider closing this one and thumbs upping the other issue to help us prioritize it! Open similar issues:
Closed similar issues:
|
Hi team, I am still experiencing network issues when trying to install a package. This has been persistent, and I have ensured my network is stable. Can you please provide guidance on how to resolve this issue? Thank you! |
Windows Version
Microsoft Windows [Version 10.0.22631.4602]
WSL Version
2.3.26.0
Are you using WSL 1 or WSL 2?
Kernel Version
5.15.167.4-1
Distro Version
24.04
Other Software
Other Software:
pip 24.0 from /usr/lib/python3/dist-packages/pip (python 3.12)
Python 3.12.3
Repro Steps
I am using WSL 2 with Ubuntu 22.04. I am unable to install Python packages using pip. The error indicates a failure to establish an HTTPS connection to files.pythonhosted.org. The error persists even though I can ping pypi.python.org successfully. Below are the steps to reproduce the issue:
python -m venv venv
source venv/bin/activate
pip install django
Error logs:
Retry(total=4, connect=None, read=None, redirect=None, status=None)...
Failed to establish a new connection: [Errno -2] Name or service not known
Steps I have tried to resolve the issue:
Despite these efforts, the problem persists.
Expected Behavior
I expected to successfully install Python packages using pip within my WSL environment. Specifically:
pip install django==4.2.15
in a virtual environment created withpython -m venv
.Documentation reference: PyPI - Installing packages using pip
Actual Behavior
When attempting to install Python packages using pip in WSL, I encountered repeated connection failures. Below are the details:
pip install django==4.2.15
in the activated virtual environment.ERROR: Could not install packages due to an OSError: HTTPSConnectionPool(host=‘files.pythonhosted.org’, port=443): Max retries exceeded with url: /packages/58/0b/8a4ab2c02982df4ed41e29f28f189459a7eba37899438e6bea7f39db793b/Django-5.1.4-py3-none-any.whl.metadata (Caused by NewConnectionError(’<pip._vendor.urllib3.connection.HTTPSConnection object at 0x7f2756538950>: Failed to establish a new connection: [Errno -2] Name or service not known’
Diagnostic Logs
No response
The text was updated successfully, but these errors were encountered: