错误如下
Collecting qpth>=0.0.15 (from learn2learn)
Downloading qpth-0.0.15.tar.gz (11 kB)
Preparing metadata (setup.py) ... error
error: subprocess-exited-with-error
× python setup.py egg_info did not run successfully.
│ exit code: 1
╰─> [3 lines of output]
error in qpth setup command: 'install_requires' must be a string or list of strings containing valid project/version requirement specifiers; Expected end or semicolon (after version specifier)
numpy>=1<2
~~~^
[end of output]
note: This error originates from a subprocess, and is likely not a problem with pip.
error: metadata-generation-failed
× Encountered error while generating package metadata.
╰─> See above for output.
note: This is an issue with the package mentioned above, not pip.
hint: See above for details.
解决方法
去pypi下载qpth包 https://pypi.org/project/qpth/#files
解压qpth-0.0.15.tar.gz
后,打开setup.py
将下面代码
install_requires=[
'numpy>=1<2',
]
改为
install_requires=[
'numpy>=1',
]
在解压qpth-0.0.15.tar.gz
后的路径下,命令行运行
pip install .
装好qpth库后,再重新安装learn2learn库就不会报qpth库的错误了。