- HoriLiu / Anaconda Proxy Setup
- This comment has been minimized.
- tidypy commented May 3, 2019 •
- Как включить прокси-серверы с Anaconda Python?
- Как настроить anaconda py для внешних соединений (API, PIP) с прокси и аутентификацией?
- Python Anaconda Proxy Setup via .condarc file on Windows
- 4 Answers 4
- Package Plan
- How to enable proxy servers with anaconda python?
HoriLiu / Anaconda Proxy Setup
#Create a .condarc file at: C:\Users\username folder. |
http://conda.pydata.org/docs/config.html#the-conda-configuration-file-condarc |
Example: conda config —add channels r |
use copy con .condarc file if does not exist at above folder. |
File content is: |
proxy_servers: |
http: http://username:password@corp.com:8080 |
https: https://username:password@corp.com:8080 |
(DO NOT USE tabs, must be space between http: and http://. ) |
You might not have a username and password for proxy still works. |
This comment has been minimized.
Copy link Quote reply
tidypy commented May 3, 2019 •
!!Writing into the text file .condarc will corrupt the file and Anaconda navigator will not load until you delete it.
you must launch Spyder; then edit through command line using command below:
use the syntax exactly only change the [username,password@corp.com:Port8080] , do not change any other syntax.
First create a copy of the .condarc file.
Next open the .condarc file in Spyder.
now go to command line and enter:
conda config —set proxy_servers http: ‘http://username:password@corp.com:8080/’
conda config —set proxy_servers https: ‘https://username:password@corp.com:8080/’
at that point Spyder will edit the .condarc file. check this by clicking the .condarc file in Spyder; it should prompt you to refresh and new text should appear. If not; the syntax is wrong.
**Now the file will be available for manual Edit. Now you can type the below data manually into the file.
**Pay attention to the syntax: each space and quote is crucial. remove junk characters from the file such as ‘?’ and ‘:’
You Must have a «/» at the end of your proxy link. this is written. in the anaconda documentation for config of proxy.
If you do not need username/password. use this setup with the —ssl_verify switch set to false
if you require a password set the switch to True; and it will prompt you for a password. (if you have dual monitor look out for the pop up).
if your company proxy uses only one HTTP address; enter this address into both HTTP and HTTPS lines.
conda config —set ssl_verify false
Edit the .condarc file manually and add this:
proxy_servers:
http: http://proxy.corp.com:8080/
https: https://proxy.corp.com:8080/
you should be good to go;
Test this by doing an update; type the following and wait about 3 minutes:
conda update -n root conda
Good luck:
I will note that your corporate «IT» will not typically make a firewall exception for you to bypass proxy; and you must use a proxy.
Therefore with the proper proxy info; this should work.
The day Anaconda incorporates «AutoDetect Proxy»; . hmmmm afterthought?
Как включить прокси-серверы с Anaconda Python?
Мы пытаемся заставить установку conda (на windows 8) работать за брандмауэром через прокси-сервер. В настоящее время мы можем использовать pip для установки пакетов в сети нашей компании, используя это в командной строке:
Не нужно указывать пароли, только прокси-сервер и порт. В документации conda говорится, что прокси-серверы возможны:
Я пробовал это с различными комбинациями, чтобы посмотреть, смогу ли я заставить его работать с или без ввода моего имени пользователя и пароля.
Я не могу заставить его работать. Пробовал разные комбинации цитирования (пароли имеют специальные символы). Также пробовал с и без домена \ user.
Я могу видеть под капотом, conda использует urlib3 (в то время как pip может использовать обработчик прокси urlib ?). Обратите внимание, что ваши имя пользователя и пароль в файле обычно не одобряются.
Я знаю, что мы могли бы установить наш собственный http или канал определения местоположения файла и поместить все пакеты туда и добавить канал в настройки конфигурации .condarc. Однако я бы предпочел не управлять хранилищем пакетов и версий локально.
Итак . есть ли способ указать в файле .condarc прокси-сервер и порт (без имени пользователя и пароля), чтобы установка conda работала за брандмауэром, как установка pip в командной строке? Или даже встроенный вызов типа pip имеет и работает . что-то вроде:
PS: я действительно люблю Конду. Я провел прошлые выходные, настраивая множество виртуальных сред на своем домашнем ПК. Документация была отличной, и все работало без нареканий. В целом, намного лучше, чем pip . если бы мы только могли заставить это работать внутри нашей компании:)
Как настроить anaconda py для внешних соединений (API, PIP) с прокси и аутентификацией?
есть потребность использовать в использовании requests.get;pip install.
Использую JNotbook.
Во всех случаях соединений с внешним миром нужно как то прописать proxy и пользовательский логин/пароль.
схема:
со скопированными из IE прокси-свойствами xxx не работает. Читал про способ cntlm но не вкурил в настройку.
Буду признателен за наводку. Может кто сталкивался с аналогичными проблемами?
- Вопрос задан более трёх лет назад
- 551 просмотр
а непосредственно в JNotebook никак?
адрес корпоративного прописывается в строке »
# List of parent proxies to use. More proxies can be defined
# one per line in format :#
У меня прокси имеет вид «http://xxx-xxx.xxx.xxxx:1111» — так и писать в строке proxy?
выставил 3388,
Команда cntlm.exe — v дает:
Default config file opened successfully
cntlm: Proxy listening on 127.0.0.1:3388
Adding no-proxy for: ‘localhost’
Adding no-proxy for: ‘127.0.0.*’
Adding no-proxy for: ’10.*’
Adding no-proxy for: ‘192.168.*’
cntlm: Workstation name used: MOS-5491
cntlm: Using following NTLM hashes: NTLMv2(1) NT(0) LM(0)
cntlm: PID 5208: Cntlm ready, staying in the foregroun
telnet www.ya.ru 3388
Подключение к www.ya.ru. Не удалось открыть подключение к этому узлу, на порт 3388: Сбой подключения
да у меня настройки прокси закрытым сетевым админом 🙂
я не могу менять их
Настройки прокси точно соответствуют (у нас websense (ip брал пинг и адрес proxy), порт админы сказали, а логин/пароль с которым каждый день работаю 🙂
Настроил, все как в инструкции, все равно ошибка:
C:\>set proxy_http = localhost:3388
C:\>pip install beautifullsoap4
Collecting beautifullsoap4
Retrying (Retry(total=4, connect=None, read=None, redirect=None)) after connection broken by ‘ConnectTimeoutError(, ‘Connection to pypi.python.org timed out. (connect timeout=15)’)’: /simple/beautifullsoap4/
telman8,
Вот я прежде чем писать — гуглил 🙂 Потому и написал, что все способы нагугленные не помогают пройти корпоративный firewall
3188 занят , поэтому поставил 3388, так как он свободен.
я описался, когда писал set proxy_http. Проблема с авторизацией. Может есть иные способы?
C:\set https_proxy=localhost:3388
C:\pip install beautifullsoap4
Retrying (Retry(total=4, connect=None, read=None, redirect=None)) after connection broken by ‘ProxyError(‘Cannot connect to proxy.’, OSError(‘Tunnel connection failed: 407 Proxy Authorization Required’,))’: /simple/beautifullsoap4/
Если ставить 3188, почему этот порт(?) — так как в INI я явно 3388 писал возникает другая ошибка:
Retrying (Retry(total=4, connect=None, read=None, redirect=None)) after connection broken by ‘ProxyError(‘Cannot connect to proxy.’, NewConnectionError(‘: Failed to establish a new connection: [WinError 10061] Подключение не установлено, т.к. конечный компьютер отверг запрос на подключение’,))’: /simple/beautifullsoap4/
Python Anaconda Proxy Setup via .condarc file on Windows
I am having trouble going through a proxy for Anaconda install conda on a Windows 7 machine. How do I use a proxy?
4 Answers 4
I had to create a .condarc file at the C:\Users\username folder.
Use copy con .condarc file if it does not exist at folder above.
File content is:
- Do not use tabs, there must be space between http: and http://.
- You might not have a username and password for the proxy. Leave out the username:password part and it will still work
On Windows 10 you need to set up additionally the domain name in the .condarc:
On windows 10 machine also. Following accepted answer’s format gives a load error, invalid YAML.
Changing ‘//’ to ‘\’ fixed the issue for me.
In my case on a linux machine behind a McAfee web-gateway proxy, only the following setup worked for conda (I removed the http proxy): hostname:
# cat .condarc proxy_servers: https: https://domain\user:password@server:port
hostname# conda install tensorflow Solving environment: done
Package Plan
environment location: /anaconda3
added / updated specs: — tensorflow
The following packages will be downloaded:
The following NEW packages will be INSTALLED:
How to enable proxy servers with anaconda python?
We are trying to get the conda install (on windows 8) to work behind a firewall via a proxy server. Currently, we are able to use pip to install packages while on our company network by using this at the command prompt:
No passwords need to be specified, just the proxy server and port. The conda documentation states that proxy servers are possible:
I have tried this with various combinations to see if I can get it to work with or without putting in my username and password.
I cannot seem to get it to work. Tried various combinations of quoting things too (passwords have special chars). Also tried with and without the domain\user.
I can see under the hood, conda is using urlib3 (while pip may be using urlib proxy handler?). Note that having your username and password in a file is generally frowned upon.
I know we could set up our own http or file location channel and put all the packages there and add the channel to the .condarc config settings. However I would prefer not to have to manage a repository of packages and versions locally.
So. is there a way to specify, in the .condarc file the proxy server and port (without user and password) so that conda install works behind a firewall just like pip install on the command line? Or even an inline call like pip has and works. something like:
Thanks in advance.
PS: I really love conda. I spent last weekend setting up many virtual environments on my home PC. Documentation was great and everything worked flawlessly. Overall, much better than pip. if only we could only get this to work inside our company 🙂