windows: pip: Failed to establish a new connection: [WinError 10013]

  • 1 year ago
Comment

ChatGPTChatGPT
1 / 1

The error "pip: Failed to establish a new connection: [WinError 10013]" typically occurs when there is a network connectivity issue preventing pip from establishing a connection to the server. The WinError 10013 specifically indicates a "Permission Denied" error. Here are a few steps you can try to resolve the issue:

  1. Check your internet connection: Ensure that you have a stable internet connection and try accessing other websites or services to confirm that your internet is working properly.

  2. Temporarily disable any antivirus or firewall: Sometimes, antivirus software or firewall settings can block pip from establishing a connection. Temporarily disable your antivirus or firewall and try running pip again. If pip works after disabling the security software, you may need to adjust the settings to allow pip through the firewall or whitelist it in your antivirus software.

  3. Use the --proxy flag: If you are behind a proxy server, you might need to configure pip to use the proxy. You can do this by specifying the proxy server using the --proxy flag. For example:

    go
    pip install package-name --proxy=http://your-proxy-server:port

    Replace your-proxy-server with the URL or IP address of your proxy server and port with the corresponding port number.

  4. Upgrade pip: Ensure that you have the latest version of pip installed. Run the following command to upgrade pip:

    css
    python -m pip install --upgrade pip

    This will upgrade pip to the latest version.

  5. Try using a different network: If possible, try connecting to a different network, such as switching from Wi-Fi to a wired connection or using a different internet service provider, to see if the issue is specific to your current network.

  6. Check proxy settings in your environment: If you are using a proxy, verify that the proxy settings in your environment variables or system settings are correct. You can check this by running the following command:

    bash
    echo %HTTP_PROXY%

    It should display the correct proxy server address. If it shows an incorrect value, you can update it by running the following command:

    arduino
    setx HTTP_PROXY "http://your-proxy-server:port"

    Replace your-proxy-server with the URL or IP address of your proxy server and port with the corresponding port number.

By following these steps, you should be able to troubleshoot and resolve the "Failed to establish a new connection: [WinError 10013]" error with pip on Windows.