@Raghul Kannan Thank you for reaching out.
As the question is tagged with Azure firewall, I am assuming you have configured applications rules to allow FQDN's pypi.python.org,pypi.org,pythonhosted.org,files.pythonhosted.org
with protocols Http:80,Https:443,Https:3128
but you are still unable to install any pip components and unable to reach pypi.org
Based on my understanding above, you can try below mentioned troubleshooting steps and see if you are able to resolve the issue.
- As you are unable to reach pypi.org, this can be a DNS issue. To validate you can run the command
nslookup pypi.org
and see if it is resolving an IP address. If there is no output received, you can check if you need to configure a Network rule on your firewall to allow communication via port 53(DNS). You can follow the example here. - Next you can try to enable diagnostic logging for your Azure Firewall and validate if any firewall rule is blocking this connectivity.
- This issue can be also related to NSGs deployed in your virtual network which might block this connectivity. You can follow this documentation here to help diagnose the nsg rules.
Hope this helps! Please let me know if the issue still persists. Thank you!