I ran into an issue where pip wasn’t working due to network restrictions. At the same time, I had access to a SOCKS5 proxy at:
192.168.1.100:1080
The problem was that pip doesn’t support SOCKS proxies out of the box. Normally, you’d install PySocks to enable that — but since pip itself wasn’t working, that wasn’t an option.
I used the ProxyMapService to expose the SOCKS5 proxy as a local HTTP proxy. Here’s the rule I configured:
{
"Listen": {
"Port": 10000,
"RejectHttpProxy": false
},
"Authentication": {
"Required": false,
"Verify": false,
"SetAuthentication": false
},
"ProxyServers": {
"Items": [
{
"Host": "192.168.1.100",
"Port": 1080,
"ProxyType": "Socks5"
}
]
}
}
After that, pip started working by pointing it to the local HTTP proxy:
pip install cython --proxy http://127.0.0.1:10000
Collecting cython
Using cached cython-3.2.4-cp311-cp311-win_amd64.whl.metadata (7.7 kB)
Using cached cython-3.2.4-cp311-cp311-win_amd64.whl (2.8 MB)
Installing collected packages: cython
Successfully installed cython-3.2.4
🎉