Pycharm Pip安装将无法在代理后面工作 [英] Pycharm pip install wont work behind a proxy

查看:513
本文介绍了Pycharm Pip安装将无法在代理后面工作的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试从 Pycharm 中安装软件包在Windows 10中,我位于代理服务器后面,因此我已经设置了代理服务器信息以及登录详细信息,并且我的连接似乎正常.

I'm trying to install packages from within Pycharm in Windows 10. I am behind a proxy, so I have set up the proxy information as well as my login details and my connection seems to work.

我的问题是 pip

My problem is that both pip and Setup_tools seems fails to connect to the internet and I get the following error after multiple connections retries have failed:

No matching distribution found for [package name]

例如,当我尝试安装Numpy时:

For example, when I try to install Numpy:

PS:

  • I have looked at a similar question over here, however I didn't find that helpful.

在执行以下操作后,我已经设法从命令提示符(CMD)中获得pip的工作:

I have managed to get pip to work from the command prompt(CMD) after doing the following:

  1. 导出代理设置:

  1. Export the proxy settings :

set http_proxy=http://username:password@proxyAddress:port

set https_proxy=https://username:password@proxyAddress:port

安装软件包:

pip install PackageName

由于某种原因,以下类型的安装似乎无法正常工作(请注意,这与Pycharm试图用于安装我的软件包的语句相同):

For some reason, the following kind of install seem to not work (note this is the same kind of statement Pycharm is trying to use to install my packages):

pip install --proxy=https://username:password@proxy:port packageName

我做错了什么?我该如何解决?提前致谢.

What am I doing wrong? How do I resolve this? Thanks in advance.

推荐答案

您的问题可能有两个原因.首先想到的是:

There might be a couple of reasons for your issue. The first that come to mind are:

  • 您是否尝试过使用Python3可执行路径并尝试使用CMD中的相同命令?

  • did you try to go to Python3 executable path and try the same command from CMD ?

pip3.exe install --proxy=https://username:password@proxy:port packageName

  • 您也可以尝试与上述相同的命令,但有一点变化:

  • you can also try the same command as above, but a bit changed:

    pip3.exe install packageName --proxy=https://username:password@proxy:port
    

  • 您确定凭据可以吗? (显然连接是成功的,我刚刚看到了第一张图片)

  • are you sure the credentials are ok ? (apparently the connection was successfull, I just saw the first image)

    我正在使用后一个命令,它在Windows上的Python 3.5.x上也能正常工作.

    I'm using the latter command and it works fine with Python 3.5.x on Windows.

    这篇关于Pycharm Pip安装将无法在代理后面工作的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

  • 查看全文
    登录 关闭
    扫码关注1秒登录
    发送“验证码”获取 | 15天全站免登陆