pycharm proxy issue cant install new packages.
Struggling to get PyCharm community working in my environment. I see packages listed for install but after selecting any of the for install I see the same error as follows.
Collecting 1and1
Retrying (Retry(total=4, connect=None, read=None, redirect=None)) after connection broken by 'ProtocolError('Connection aborted.', error(10054, 'An existing connection was forcibly closed by the remote host'))': /simple/1and1/
Retrying (Retry(total=3, connect=None, read=None, redirect=None)) after connection broken by 'ProtocolError('Connection aborted.', error(10054, 'An existing connection was forcibly closed by the remote host'))': /simple/1and1/
Retrying (Retry(total=2, connect=None, read=None, redirect=None)) after connection broken by 'ProtocolError('Connection aborted.', error(10054, 'An existing connection was forcibly closed by the remote host'))': /simple/1and1/
Retrying (Retry(total=1, connect=None, read=None, redirect=None)) after connection broken by 'ProtocolError('Connection aborted.', error(10054, 'An existing connection was forcibly closed by the remote host'))': /simple/1and1/
Retrying (Retry(total=0, connect=None, read=None, redirect=None)) after connection broken by 'ProtocolError('Connection aborted.', error(10054, 'An existing connection was forcibly closed by the remote host'))': /simple/1and1/
Could not find a version that satisfies the requirement 1and1 (from versions: )
No matching distribution found for 1and1
I have checked the box to install "users site packages directory". My machine is on a corporate network behind a proxy. I have configure proxy settings using the automated setting. I tried manualy inserting proxy values and it toggeled to automatic.
I can install packages outside of pycharm at command prompt using command like the following.
pip install --user tweepy --proxy http://proxy.at.my.company.com:80 -v
once installed with the above command I can remove package using the Pycharm interface. It seem like Pycharm is not using proxy but I don know how to force it to or alter settings so it works similar to command propmt scenario.
Appreciate any help.
请先登录再写评论。
Please try to put information about proxy in the options field.
Semyon, The above does appear to resolve proxy issue I was having. Thanks for sharing. Any idea why the proxy configs on the setting page do not work for installing packages?
It's a bug. Could you please file an issue in our issue tracker?
Thank you Semyon. I was looking to work around this issue.
Is there any update to this issue. I tried the above work around, but it does not seem to work for me.
Hi Krunal,
Please report it to https://youtrack.jetbrains.com/issues/PY and attach your idea.log (Help | Show Log in...) after reproducing the problem.
It doesn't work with virtualenv (e. g. for Py checkiO)
I'd prefer Pycharm asks my password for enterprise proxy when it get 407 error.
@Ilis
Are you able to install packages into the same interpreter from the system terminal (outside of PyCharm)?
@Sergey
Yes, I do it with setting environment in cmd (it doesn't store history, so I can type my password relatively safe)
D:\PyCheckiO\.idea\VirtualEnvironment\Scripts>set NO_PROXY="corp.domain\username:password@tmg01.corp.domain:3128"
D:\PyCheckiO\.idea\VirtualEnvironment\Scripts>pip install -U setuptools
...
Successfully installed setuptools-40.9.0
Have you tried adding this environment variable to Windows environment variables? Is it possible with your proxy?
The idea is that you could set it there, then launch PyCharm (env vars should be reloaded) and try again. If doesn't work, make sure the environment variable is loaded to PyCharm.
I don't think it is a good idea to store my password in environment. Moreover, password policy enforces users to change their passwords once a month.
Have you tried specifying similar to --proxy http://user:password@proxyserver:port in Options field?
It's according to pip's documentation.
Yes, I did. Upgrade process reported success, but virtualenv didn't changed, so I upgrade it from cmd using NO_PROXY env. There are no dedicated Options field for virtualenv packages.
Same issue as Ilis above. The proxy settings are ignored for virtualenv packages and the options field isn't available in the GUI.
It works just fine from the CLI.
$ source venv/bin/activate
(venv) $ pip install --upgrade setuptools==41.0.0 --proxy http://****:********@*******.***:80
DEPRECATION: Python 2.7 will reach the end of its life on January 1st, 2020. Please upgrade your Python as Python 2.7 won't be maintained after that date. A future version of pip will drop support for Python 2.7.
Collecting setuptools
Downloading https://files.pythonhosted.org/packages/c8/b0/cc6b7ba28d5fb790cf0d5946df849233e32b8872b6baca10c9e002ff5b41/setuptools-41.0.0-py2.py3-none-any.whl (575kB)
100% |████████████████████████████████| 583kB 1.7MB/s
Installing collected packages: setuptools
Found existing installation: setuptools 40.8.0
Uninstalling setuptools-40.8.0:
Successfully uninstalled setuptools-40.8.0
Successfully installed setuptools-41.0.0
(venv) $ deactivate
$
So you were able to install packages, but the package isn't shown among installed ones in your virtualenv?
Now I can't upgrade setuptools in venv using GUI and --proxy option
Retrying (Retry(total=4, connect=None, read=None, redirect=None, status=None)) after connection broken by 'ProxyError('Cannot connect to proxy.', OSError('Tunnel connection failed: 407 Proxy Authentication Required ( ... )'))': /simple/setuptools/
Does the same command (not the one with setting env var) work from command line?
If not, I would suggest to submit a feature request about proxy username/password prompting to https://youtrack.jetbrains.com/issues/IDEA
Well, I just check it with cmd
D:\PyCheckiO\.idea\VirtualEnvironment\Scripts>pip install --proxy="https://corp.domain\ilis:password@tmg01.corp.domain
:3128" -U setuptools
Retrying (Retry(total=4, connect=None, read=None, redirect=None, status=None)) after connection broken by 'ProxyError('C
annot connect to proxy.', OSError('Tunnel connection failed: 407 Proxy Authentication Required ( ... )'))': /simple/setuptools/
...
Requirement already up-to-date: setuptools in d:\pycheckio\.idea\virtualenvironment\lib\site-packages (40.9.0)
D:\PyCheckiO\.idea\VirtualEnvironment\Scripts>set NO_PROXY="https://corp.domain\ilis:password@tmg01.corp.domain
:3128"
D:\PyCheckiO\.idea\VirtualEnvironment\Scripts>pip install -U setuptools
Collecting setuptools
Downloading https://files.pythonhosted.org/packages/c8/b0/cc6b7ba28d5fb790cf0d5946df849233e32b8872b6baca10c9e002ff5b41
/setuptools-41.0.0-py2.py3-none-any.whl (575kB)
100% |████████████████████████████████| 583kB 2.8MB/s
Installing collected packages: setuptools
Found existing installation: setuptools 40.9.0
Uninstalling setuptools-40.9.0:
Successfully uninstalled setuptools-40.9.0
Successfully installed setuptools-41.0.0
You are using pip version 10.0.1, however version 19.0.3 is available.
You should consider upgrading via the 'python -m pip install --upgrade pip' command.
One more issue is about pip version. pip reported version 10.0.1 and prompt for upgrade, but upgrade reported version is 19.0.3
D:\PyCheckiO\.idea\VirtualEnvironment\Scripts>python -m pip install --upgrade pip
Requirement already up-to-date: pip in d:\pycheckio\.idea\virtualenvironment\lib\site-packages (19.0.3)