Python pip error: “Cannot fetch index base URL https://pypi.python.org/simple/”

后端 未结 6 633
死守一世寂寞
死守一世寂寞 2021-02-05 08:38

I\'m trying to install several packages using pip. When I do this using sudo, this error occurs: \"Cannot fetch index base URL https://pypi.python.org/simple/\". When I execute

6条回答
  •  别跟我提以往
    2021-02-05 09:04

    Maybe try with sudo -E:

     -E          The -E (preserve environment) option indicates to the secu‐
                 rity policy that the user wishes to preserve their existing
                 environment variables.  The security policy may return an
                 error if the -E option is specified and the user does not
                 have permission to preserve the environment.
    

    On the assumption that your proxy settings are set in your normal user environment, but not the one you get when you run sudo.

提交回复
热议问题