Problem
When attempting to import various Python packages installation fails with a timeout error caused by a corporate proxy.
Cause
Pip relies on environment variables and/or pip.ini configuration for proxy settings during package installation. While PyCharm's "No proxy" setting allows "Check Connection" to work, the actual installation process performed by pip is affected by the corporate proxy, resulting in connection timeout errors.
Resolution
Step 1: Verify the issue outside PyCharm
Use the system terminal to attempt the installation and confirm the issue is proxy-related:
"C:\Users\<User>\AppData\Local\Programs\Python\Python314\python.exe" -m pip install -vvv <package_name>
If the timeout error persists, the issue is independent of PyCharm.
Step 2: Check pip.ini configuration
Verify if proxy settings are defined in pip.ini files:
-
User-level
pip.ini:C:\Users\<User>\AppData\Roaming\pip\pip.ini -
System-level
pip.ini:C:\ProgramData\pip\pip.ini
Refer to pip's official documentation for detailed guidance on configuring proxies.
Step 3: Update proxy settings or use an alternative solution
If your corporate proxy blocks direct connections, configure the correct proxy credentials in pip.ini or use an alternative approach, such as downloading packages manually and installing them via pip install <package_name>.whl.
For persistent proxy issues, consult your IT department to explore further options.
If additional assistance is required, contact JetBrains Support.
Comments
0 comments
Please sign in to leave a comment.