Pycharm pip install wont work behind a proxy

2019-03-27 18:16发布

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.

internet connection

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:

errors im getting

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.

4条回答
萌系小妹纸
2楼-- · 2019-03-27 18:25

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.

查看更多
手持菜刀,她持情操
3楼-- · 2019-03-27 18:33

Create a System Environment Variable HTTPS_PROXY or HTTP_PROXY in windows with required authentication (https://user:password@proxy:port) in windows and restart Pycharm.

Then, without specifying proxy configuration inside Pycharm, install the package.

查看更多
等我变得足够好
4楼-- · 2019-03-27 18:40

In PyCharm you can specify the proxy in the options field in the Available Packages Dialog:

Available Packages Dialog

This dialog is reachable from the Project Interpreter page by clicking the + button

查看更多
一夜七次
5楼-- · 2019-03-27 18:46

This is best solution :

pip install requests

that command is not work, in Pycharm and reason is proxy or web filtering and something like this;

for fixing this problem you could do these steps :

  1. go to https://pypi.org/project/

  2. then find your package ( requests )

  3. then in Download section copy .targz link address

  4. in Pycharm terminal type : pip install (your link address that you copied)

  5. now press enter so you will know your package would need some dependencies so

repeat these steps for dependencies.

( Note : be careful on version of package dependencies that you need.)

查看更多
登录 后发表回答