Troubleshooting Pip Proxy Configuration with CNTLM
Can you access resources via HTTP and HTTPS? If not, start by verifying if your local CNTLM proxy is correctly configured and pointing to the required proxy server. To check that, you can use the command sudo curl http://www.google.com/ and examine the response. You can also try CNTLM's command-line tool cntlm -c ~/.cntlm.rc -M http://www.google.com/. If either of these commands fails, CNTLM may not be set up properly.
When attempting to use Pip with a proxy, consider the following:
1. CNTLM Configuration: Ensure that your CNTLM configuration file (cntlm.ini) is correct. You can use the cntlm.exe -c cntlm.ini -I -M http://google.com command to test your setup. If you encounter "Connection to proxy failed" errors, check your proxy settings and network connectivity.
2. Pip Command: Instead of the --proxy flag, try setting the HTTPS_PROXY environment variable. This approach has been found to work better with some systems. Export the variable using export HTTPS_PROXY=http://proxy-server:port and then run Pip commands as usual.
3. Other Options: If CNTLM and Pip are not working as expected, you can consider alternative methods. One option is to set the http_proxy environment variable with your proxy credentials. However, this approach may not be suitable if your proxy requires authentication.
The above is the detailed content of Is Your Pip Proxy Configuration with CNTLM Working?. For more information, please follow other related articles on the PHP Chinese website!