Pycharm pip install 不能在代理后面工作 [英] Pycharm pip install wont work behind a proxy

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

问题描述

我正在尝试从

我的问题是

附注:

  • 我看过一个类似的问题 在这里,但是我觉得这没有帮助.

  • 在执行以下操作后,我设法让 pip 从命令提示符 (CMD) 开始工作:

    1. 导出代理设置:

      设置 http_proxy=http://username:password@proxyAddress:port

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

    2. 安装包:

      pip install PackageName

出于某种原因,以下类型的安装似乎不起作用(请注意,这与 Pycharm 试图用来安装我的软件包的声明类型相同):

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

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

解决方案

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

  • 您是否尝试转到 Python3 可执行路径并从 CMD 尝试相同的命令?

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

  • 您也可以尝试与上述相同的命令,但略有不同:

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

  • 你确定凭据没问题吗?(显然连接成功了,我刚看到第一张图)

  • 代理启动了吗?(显然是连接成功了,我刚看到第一张图)

我正在使用后一个命令,它在 Windows 上的 Python 3.5.x 上运行良好.

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.

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]

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.

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

    1. Export the proxy settings :

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

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

    2. Install the package:

      pip install PackageName

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:

  • 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)

  • is the proxy up ? (apparently the connection was successfull, I just saw the first image)

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

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

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