【发布时间】:2021-06-07 15:24:09
【问题描述】:
我不能使用 20.2.4 以外的更高版本的 pip,因为更高版本会发生一些 SSL 认证错误,并且无法重新安装我现在的任何设置(因为某些办公室设置)。 现在我正在使用 Pycaret,目前它只支持 sklearn 0.23.2。
但我的 sklearn 版本是 0.24.1,我无法使用 20.2.4 版本的 pip 降级。
我也尝试使用 setup.py 文件手动安装,但也不成功。
我有 Winpython,也无法安装 anaconda。
有人可以帮我解决这个问题吗?我有 python 3.9 。可能是这个问题吗?
更新:
Error message:
Collecting scikit-learn==0.23.2
Using cached scikit-learn-0.23.2.tar.gz (7.2 MB)
Installing build dependencies ... error
ERROR: Command errored out with exit status 1:
command: 'C:\Users\me\Desktop\WPy64-3902\Scripts\python.exe' 'C:\Users\me\Desktop\WPy64-3902\lib\site-packages\pip' install --ignore-installed --no-user --prefix 'C:\Users\me\AppData\Local\Temp\pip-build-env-w5t8h2zr\overlay' --no-warn-script-location --no-binary :none: --only-binary :none: -i https://pypi.org/simple -- setuptools wheel 'Cython>=0.28.5' 'numpy==1.13.3; python_version=='"'"'3.6'"'"' and platform_system!='"'"'AIX'"'"' and platform_python_implementation == '"'"'CPython'"'"'' 'numpy==1.14.0; python_version=='"'"'3.6'"'"' and platform_system!='"'"'AIX'"'"' and platform_python_implementation != '"'"'CPython'"'"'' 'numpy==1.14.5; python_version=='"'"'3.7'"'"' and platform_system!='"'"'AIX'"'"'' 'numpy==1.17.3; python_version>='"'"'3.8'"'"' and platform_system!='"'"'AIX'"'"'' 'numpy==1.16.0; python_version=='"'"'3.6'"'"' and platform_system=='"'"'AIX'"'"'' 'numpy==1.16.0; python_version=='"'"'3.7'"'"' and platform_system=='"'"'AIX'"'"'' 'numpy==1.17.3; python_version>='"'"'3.8'"'"' and platform_system=='"'"'AIX'"'"'' 'scipy>=0.19.1'
cwd: None
Complete output (547 lines):
Ignoring numpy: markers 'python_version == "3.6" and platform_system != "AIX" and platform_python_implementation == "CPython"' don't match your environment
Ignoring numpy: markers 'python_version == "3.6" and platform_system != "AIX" and platform_python_implementation != "CPython"' don't match your environment
Ignoring numpy: markers 'python_version == "3.7" and platform_system != "AIX"' don't match your environment
Ignoring numpy: markers 'python_version == "3.6" and platform_system == "AIX"' don't match your environment
Ignoring numpy: markers 'python_version == "3.7" and platform_system == "AIX"' don't match your environment
Ignoring numpy: markers 'python_version >= "3.8" and platform_system == "AIX"' don't match your environment
【问题讨论】:
-
您可以发布您遇到的错误吗?是否有理由不使用最新版本的 pip?
-
是的!升级 pip 版本后安装其他软件包时出现 SSL 认证错误。
-
您可能需要为 pip 设置受信任的主机 - 请参阅 here
-
我试过 .. 升级 pip 并运行它后,我收到以下错误:无法获取 URL pypi.org/simple/pip:确认 ssl 证书时出现问题:HTTPSConnectionPool(host='pypi.org' , port=443): 最大重试次数超出 url: /simple/pip/ (由 SSLError(SSLError(1, '[SSL: WRONG_VERSION_NUMBER] 错误版本号 (_ssl.c:1122)'))) - 跳过跨度>
-
获得正确版本的 numpy 似乎是这里的罪魁祸首...... sklearn 0.23 早于 python 3.9 并且没有更新条目在 pyproject.toml 中使用哪个 numpy 版本......瓶颈这里也有一个问题.. 我认为 pip 会感到困惑,认为有多个包对需要哪个 numpy 版本有冲突的要求。是否可以在 requirements.txt 中添加 scikit-learn 版本?我想知道 pycaret 真的 是否需要旧版本(离当前版本只有 1 个版本)
标签: python installation scikit-learn pip pycaret