美文网首页
python request及pip命令挂代理后报错ValueE

python request及pip命令挂代理后报错ValueE

作者: 嬉笑的皮皮虾 | 来源:发表于2023-02-24 23:19 被阅读0次

1先挂上代理

2获得本机代理端口

C:\Users\Administrator>python
Python 3.8.5 (default, Sep  3 2020, 21:29:08) [MSC v.1916 64 bit (AMD64)] :: Anaconda, Inc. on win32

Warning:
This Python interpreter is in a conda environment, but the environment has
not been activated.  Libraries may fail to load.  To activate this environment
please see https://conda.io/activation

Type "help", "copyright", "credits" or "license" for more information.
>>> from urllib.request import getproxies
>>> getproxies()
{'https': 'http://127.0.0.1:11000', 'http': 'http://127.0.0.1:11000'}
此处获得代理端口为11000

3创建环境变量

HTTP_PROXY: http://127.0.0.1:11000
HTTPS_PROXY: http://127.0.0.1:11000


image.png

4重启命令提示行,在挂代理的情况下使用pip验证成功

相关文章

网友评论

      本文标题:python request及pip命令挂代理后报错ValueE

      本文链接:https://www.haomeiwen.com/subject/uvffldtx.html