Date: 03/28/2024 11:00-12:00
Date: 03/27/2024 19:00-21:00
问题现象:开启代理后,无法正常下载
PS D:\workspace\winform\canvas\mysite依赖包> python -m pip install flatlib-0.2.3-py3-none-any.whl
Looking in indexes: https://mirrors.ustc.edu.cn/pypi/web/simple
Processing d:\workspace\winform\canvas\mysite依赖包\flatlib-0.2.3-py3-none-any.whl
WARNING: Retrying (Retry(total=4, connect=None, read=None, redirect=None, status=None)) after connection broken by 'ProxyError('Cannot connect to proxy.', OSError('Tunnel connection failed: 400 Bad Request'))': /pypi/web/simple/pyswisseph/
WARNING: Retrying (Retry(total=3, connect=None, read=None, redirect=None, status=None)) after connection broken by 'ProxyError('Cannot connect to proxy.', OSError('Tunnel connection failed: 400 Bad Request'))': /pypi/web/simple/pyswisseph/
WARNING: Retrying (Retry(total=2, connect=None, read=None, redirect=None, status=None)) after connection broken by 'ProxyError('Cannot connect to proxy.', OSError('Tunnel connection failed: 400 Bad Request'))': /pypi/web/simple/pyswisseph/
WARNING: Retrying (Retry(total=1, connect=None, read=None, redirect=None, status=None)) after connection broken by 'ProxyError('Cannot connect to proxy.', OSError('Tunnel connection failed: 400 Bad Request'))': /pypi/web/simple/pyswisseph/
ERROR: Operation cancelled by user
尝试直接访问网页地址
https://mirrors.ustc.edu.cn/pypi/web/simple
429 Too Many Requests
openresty
此时配置如下
pip.ini
[global]
index-url = https://pypi.python.org/simple/
问题未解决
1.尝试修改国内,国际源。都无法正常下载。依然出现刚开始的错误。
#国内源
https://mirrors.aliyun.com/pypi/simple
pip install --index-url https://pypi.tuna.tsinghua.edu.cn/simple/ pyswisseph
pip install --index-url https://mirrors.aliyun.com/pypi/simple pyswisseph
pip install --index-url https://pypi.mirrors.ustc.edu.cn/simple/ pyswisseph
pip install --index-url http://pypi.douban.com/simple/ pyswisseph
#国外源
[global]
index-url = https://pypi.org/simple/
#index-url = https://pypi.python.org/simple/
测试指令
尝试pip指定proxy,仍然报错
pip --proxy 主机号:端口号 install 下载的内容
pip --proxy 143.110.233.140:4780 install --index-url https://mirrors.aliyun.com/pypi/simple pyswisseph
pip --proxy 143.110.233.140:4780 install --index-url https://pypi.org/simple/ flatlib
pip --proxy 143.110.233.140:4780 install --index-url https://pypi.python.org/simple/ flatlib
pip install --index-url https://pypi.python.org/simple/ flatlib
错误信息
此时可以安装成功的原因是有cache,(这个执行结果是下载成功后重新复测的)
C:\Users\HASEE>pip --proxy 127.0.0.1:4780 install --index-url https://pypi.python.org/simple/ pandas
Looking in indexes: https://pypi.python.org/simple/
WARNING: Retrying (Retry(total=4, connect=None, read=None, redirect=None, status=None)) after connection broken by 'ProxyError('Cannot connect to proxy.', timeout('_ssl.c:1074: The handshake operation timed out'))': /simple/pandas/
WARNING: Retrying (Retry(total=3, connect=None, read=None, redirect=None, status=None)) after connection broken by 'ProxyError('Cannot connect to proxy.', ConnectionResetError(10054, '远程主机强迫关闭了一个现有的连接。', None, 10054, None))': /simple/pandas/
WARNING: Retrying (Retry(total=2, connect=None, read=None, redirect=None, status=None)) after connection broken by 'ProxyError('Cannot connect to proxy.', timeout('_ssl.c:1074: The handshake operation timed out'))': /simple/pandas/
WARNING: Retrying (Retry(total=1, connect=None, read=None, redirect=None, status=None)) after connection broken by 'ProxyError('Cannot connect to proxy.', ConnectionResetError(10054, '远程主机强迫关闭了一个现有的连接。', None, 10054, None))': /simple/pandas/
Collecting pandas
Using cached pandas-1.3.5-cp37-cp37m-win_amd64.whl.metadata (12 kB)
Requirement already satisfied: python-dateutil>=2.7.3 in d:\webjava\python37\lib\site-packages (from pandas) (2.9.0.post0)
Requirement already satisfied: pytz>=2017.3 in c:\users\hasee\appdata\roaming\python\python37\site-packages (from pandas) (2021.1)
Requirement already satisfied: numpy>=1.17.3 in d:\webjava\python37\lib\site-packages (from pandas) (1.21.6)
Requirement already satisfied: six>=1.5 in d:\webjava\python37\lib\site-packages (from python-dateutil>=2.7.3->pandas) (1.16.0)
Using cached pandas-1.3.5-cp37-cp37m-win_amd64.whl (10.0 MB)
Installing collected packages: pandas
Successfully installed pandas-1.3.5
尝试过无用的解决失败的解决方法
1.IE代理设置
2.win10代理设置
方法一
关键文件
修改后立即生效,无需重新cmd(windows10)
C:\Users\HASEE\AppData\Roaming\pip
pip.ini
[global]
index-url = https://pypi.python.org/simple/
proxy = http://127.0.0.1:4780
trusted-host = pypi.org
最终结果:
下载速度突破1MB限制
开启proxy程序选择节点即可
方法二
此配置需要如下使用。
[global]
proxy = http://mirrors.aliyun.com/pypi/simple/
index-url = https://pypi.tuna.tsinghua.edu.cn/simple/
pip --proxy 127.0.0.1:4780 install --index-url https://mirrors.aliyun.com/pypi/simple pyswisseph
pip --proxy 127.0.0.1:4780 install --index-url https://pypi.org/simple/ flatlib
pip --proxy 127.0.0.1:4780 install --index-url https://pypi.python.org/simple/ flatlib
安装flatlib->pyswisseph报错
Processing d:\workspace\winform\canvas\mysite依赖包\pyswisseph-2.10.2.0-cp37-cp37m-win_amd64.whl
Installing collected packages: pyswisseph
Successfully installed pyswisseph-2.10.2.0
Collecting flatlib
Using cached flatlib-0.2.3-py3-none-any.whl.metadata (733 bytes)
Collecting pyswisseph==2.08.00-1 (from flatlib)
Using cached pyswisseph-2.08.00-1.tar.gz (521 kB)
Preparing metadata (setup.py) ... done
Using cached flatlib-0.2.3-py3-none-any.whl (5.8 MB)
Building wheels for collected packages: pyswisseph
Building wheel for pyswisseph (setup.py) ... error
error: subprocess-exited-with-error
× python setup.py bdist_wheel did not run successfully.
│ exit code: 1
╰─> [6 lines of output]
Searching system libswe...
pkg-config not found
Using internal libswe
d:\workspace\winform\canvas\mysitethinktanker20231219\venv_379\lib\site-packages\setuptools\dist.py:510: InformationOnly: Normalizing '2.08.00-1' to '2.8.0.post1'
self._validate_version(self.metadata.version)
error: Microsoft Visual C++ 14.0 or greater is required. Get it with "Microsoft C++ Build Tools": https://visualstudio.microsoft.com/visual-cpp-build-tools/
[end of output]
note: This error originates from a subprocess, and is likely not a problem with pip.
ERROR: Failed building wheel for pyswisseph
Running setup.py clean for pyswisseph
Failed to build pyswisseph
ERROR: Could not build wheels for pyswisseph, which is required to install pyproject.toml-based projects
解决办法
https://download.visualstudio.microsoft.com/download/pr/1afa33fc-e800-4714-9e19-31b928ea2572/1fc592e65b7c697cb80f96ae2c2f7ac9e6b366fecd42d7ecb451cc9f0de89624/vs_BuildTools.exe
下载"vs_BuildTools.exe"进行安装
备注:
—中途遇到某个依赖无法下载成功,可以使用此指令单独下载
pip install --index-url https://pypi.python.org/simple/ flatlib
–此行代码proxy没有生效。
pip --proxy 127.0.0.1:4780 install --index-url https://pypi.python.org/simple/ flatlib
错误信息:
Building wheel for jieba (setup.py) ... done
Created wheel for jieba: filename=jieba-0.39-py3-none-any.whl size=7282595 sha256=5348a5268931db1eabd31767cca2d65aa20a210e1e0af66b8dff7e492913a9aa
Stored in directory: c:\users\hasee\appdata\local\pip\cache\wheels\0b\bd\b6\98ff4794102a7aadfc99837584f5572698209446c907579a5f
Building wheel for jupyter-latex-envs (setup.py) ... done
Created wheel for jupyter-latex-envs: filename=jupyter_latex_envs-1.4.6-py2.py3-none-any.whl size=963430 sha256=d5f0e4c5853c75dd54bb0b9dba58b7b0b59c56dd7dda1006e750c08b3c7259f1
Stored in directory: c:\users\hasee\appdata\local\pip\cache\wheels\94\e6\66\7edabb346d0ce22826c461c0bc8d6b48386ecf06ff43c7cdb6
Building wheel for mysqlclient (setup.py) ... error
error: subprocess-exited-with-error
× python setup.py bdist_wheel did not run successfully.
│ exit code: 1
╰─> [23 lines of output]
running bdist_wheel
running build
running build_py
creating build
creating build\lib.win-amd64-cpython-37
creating build\lib.win-amd64-cpython-37\MySQLdb
copying MySQLdb\__init__.py -> build\lib.win-amd64-cpython-37\MySQLdb
copying MySQLdb\_exceptions.py -> build\lib.win-amd64-cpython-37\MySQLdb
copying MySQLdb\connections.py -> build\lib.win-amd64-cpython-37\MySQLdb
copying MySQLdb\converters.py -> build\lib.win-amd64-cpython-37\MySQLdb
copying MySQLdb\cursors.py -> build\lib.win-amd64-cpython-37\MySQLdb
copying MySQLdb\release.py -> build\lib.win-amd64-cpython-37\MySQLdb
copying MySQLdb\times.py -> build\lib.win-amd64-cpython-37\MySQLdb
creating build\lib.win-amd64-cpython-37\MySQLdb\constants
copying MySQLdb\constants\__init__.py -> build\lib.win-amd64-cpython-37\MySQLdb\constants
copying MySQLdb\constants\CLIENT.py -> build\lib.win-amd64-cpython-37\MySQLdb\constants
copying MySQLdb\constants\CR.py -> build\lib.win-amd64-cpython-37\MySQLdb\constants
copying MySQLdb\constants\ER.py -> build\lib.win-amd64-cpython-37\MySQLdb\constants
copying MySQLdb\constants\FIELD_TYPE.py -> build\lib.win-amd64-cpython-37\MySQLdb\constants
copying MySQLdb\constants\FLAG.py -> build\lib.win-amd64-cpython-37\MySQLdb\constants
running build_ext
building 'MySQLdb._mysql' extension
error: Microsoft Visual C++ 14.0 or greater is required. Get it with "Microsoft C++ Build Tools": https://visualstudio.microsoft.com/visual-cpp-build-tools/
[end of output]
note: This error originates from a subprocess, and is likely not a problem with pip.
ERROR: Failed building wheel for mysqlclient
Running setup.py clean for mysqlclient
Building wheel for notifications (setup.py) ... done
Created wheel for notifications: filename=notifications-0.3.2-py3-none-any.whl size=4903 sha256=02bf59262592bce7f40c6c5ef72ac9aa33b5d48f99cd12e6ae23f61e614dec38
Stored in directory: c:\users\hasee\appdata\local\pip\cache\wheels\39\1c\2e\27d93ea6d3e8b730ab0776cd669581076dd9fa9d47ab20b653
Building wheel for pdfplumber (setup.py) ... done
Created wheel for pdfplumber: filename=pdfplumber-0.5.26-py3-none-any.whl size=31786 sha256=464625e9ed8ef297281e3ea6ffd54db97a19c89949fe07d4215c509fe56b0b3e
Stored in directory: c:\users\hasee\appdata\local\pip\cache\wheels\5f\bd\d7\a21d215eed5d598f591f6f372abb3c045bd8a24c16758068f4
Building wheel for periodictable (setup.py) ... done
Created wheel for periodictable: filename=periodictable-1.6.0-py3-none-any.whl size=749775 sha256=c4cfcce057ad95810797dee24188ba1e06b5120b97536460264178dcf52316d4
Stored in directory: c:\users\hasee\appdata\local\pip\cache\wheels\2b\9e\f9\5ddb56d9009c8ec80024c037b12c8a6c38d7934bfc70c5ec0a
Building wheel for python-docx (setup.py) ... done
Created wheel for python-docx: filename=python_docx-0.8.11-py3-none-any.whl size=184516 sha256=eb6aec586c09107eea35cd221ce2b41f28ed9ea6d500018b57c8791a7d034198
Stored in directory: c:\users\hasee\appdata\local\pip\cache\wheels\e5\a7\41\a9a4196d51aa2d7fc303c68557e1fe0842c4df7a8160c7efc6
Successfully built jieba jupyter-latex-envs notifications pdfplumber periodictable python-docx
Failed to build mysqlclient
ERROR: Could not build wheels for mysqlclient, which is required to install pyproject.toml-based projects
中间遇到flatlib,pyswisseph,mysqlclient安装失败,可以单独安装好后再注释掉
requirements.txt
fastjsonschema==2.16.1
fire==0.4.0
#flatlib==0.2.3
flower==1.0.0
fonttools==4.28.0
pyrsistent==0.18.1
#pyswisseph==2.8.0.post1
python-crontab==2.6.0
matplotlib==3.5.1
matplotlib-inline==0.1.3
mistune==0.8.4
msgpack==1.0.3
#mysqlclient==2.1.1
nbclient==0.6.6
nbconvert==6.5.2