Reputation: 49
I try to update Anaconda behind a corporate proxy. For this the network team gave me the parameters: proxy.subdomain.domain.de:1234. HTTP as well as HTTPS. However, everthing I try won't work. Either it doesn't show any effect or it returns a ConfigurationLoadError reasoned with "invalid yaml".
This configuration returns an error:
proxy_servers:
http: http://proxy.subdomain.domain.de:1234
https: https://proxy.subdomain.domain.de:1234
And this configuration doesn't work either:
proxy_servers: {http://proxy.subdomain.domain.de:1234, https://proxy.subdomain.domain.de:1234,}
I've already looked up a similar question, which solutions don't work for me, and the documentation:
Python Anaconda Proxy Setup via .condarc file on Windows
https://conda.io/projects/conda/en/latest/user-guide/configuration/use-condarc.html
https://docs.anaconda.com/anaconda/user-guide/tasks/proxy/
https://conda.io/projects/conda/en/latest/configuration.html
Can anyone please tell me what my mistake is and what the soulution is?
Upvotes: 1
Views: 1643
Reputation: 6819
Use the same indent. Use http://xxx
for both http
and https
keys if your proxy server only supports http
.
channels:
- conda-forge
proxy_servers:
http: http://user:[email protected]:8080
https: http://user:[email protected]:8080
The protocol in the URL (either http:// or https://) should match the actual protocol of your proxy server. The keys http and https in the above example merely indicate the type of traffic to route, not the protocol of the proxy server itself. Ensure that both keys use the correct protocol based on your proxy server's configuration.
https://docs.conda.io/projects/conda/en/24.7.x/user-guide/configuration/settings.html
Upvotes: 0
Reputation: 1
Formatting the .condarc file as Artai stated worked for me too:
proxy_servers:
http: proxy.company.edu:1234
https: proxy.company.edu:1234
Upvotes: 0
Reputation: 49
I've found the answer to it and it seems that is was mainly a matter of formatting:
proxy_servers:
http: proxy.subdomain.domain.de:1234
https: proxy.subdomain.domain.de:1234
I had too much spaces in front of the parameters, four spaces instead of only two spaces, and putting "http://" or "https://" in front of the parameter was also not correct.
Upvotes: 3