问题一:ERROR: pip's dependency resolver does not currently take into account all the packages that are installed. This behaviour is the source of the following dependency conflicts.
scipy 1.7.3 requires numpy<1.23.0,>=1.16.5, but you have numpy 1.26.2 which is incompatible.
numba 0.55.1 requires numpy<1.22,>=1.18, but you have numpy 1.26.2 which is incompatible.
原因:scipy与numba的版本与电脑中现存的版本不匹配。
解决方案:
方案1(无法解决):更新numpy然后再下载这两个软件包
(1)更新numpy:
pip install --upgrade numpy
(2)下载软件包:
pip install numba -i https://pypi.tuna.tsinghua.edu.cn/simple
pip install scipy -i https://pypi.tuna.tsinghua.edu.cn/simple
但是出现了新的问题,电脑中原来的软件包与降级后的numpy又不兼容了。
方案2(已解决):安装与本电脑中numpy相匹配的软件包
pip install numpy==1.26.2 scipy -i https://pypi.tuna.tsinghua.edu.cn/simple
pip install numpy==1.26.2 numba -i https://pypi.tuna.tsinghua.edu.cn/simple
该方案2出现了新的问题ERROR: Cannot uninstall 'llvmlite'. It is a distutils installed project and thus we cannot accurately determine which files belong to it which would lead to only a partial uninstall.即无法卸载llvmlite。
解决:关闭所有相关的python文件,更新llvmlite:
pip install --upgrade --user llvmlite
但是出现了报错ERROR: pip's dependency resolver does not currently take into account all the packages that are installed. This behaviour is the source of the following dependency conflicts.
numba 0.55.1 requires llvmlite<0.39,>=0.38.0rc1, but you have llvmlite 0.41.1 which is incompatible.
numba 0.55.1 requires numpy<1.22,>=1.18, but you have numpy 1.26.2 which is incompatible.
该报错说明之前的numba并没有正确更新,因此,需要重新下载一次
pip install numpy==1.26.2 numba
以防万一,我又重下载了一次spicy
pip install numpy==1.26.2 scipy。
最后运行python get_python_api.py就不会出现问题了。