pip install lap时报错:
Looking in indexes: https://pypi.tuna.tsinghua.edu.cn/simple/
Collecting lap
Using cached https://pypi.tuna.tsinghua.edu.cn/packages/bf/64/d9fb6a75b15e783952b2fec6970f033462e67db32dc43dfbb404c14e91c2/lap-0.4.0.tar.gz (1.5 MB)
Preparing metadata (setup.py) ... done
Building wheels for collected packages: lap
Building wheel for lap (setup.py) ... error
error: subprocess-exited-with-error
× python setup.py bdist_wheel did not run successfully.
│ exit code: 1
╰─> [28 lines of output]
/tmp/pip-install-7zl2qyty/lap_41e8804da0774145badb87ffc4023c16/setup.py:4: DeprecationWarning: pkg_resources is deprecated as an API. See https://setuptools.pypa.io/en/latest/pkg_resources.html
from pkg_resources import parse_version
Partial import of lap during the build process.
/tmp/pip-install-7zl2qyty/lap_41e8804da0774145badb87ffc4023c16/setup.py:223: DeprecationWarning:
`numpy.distutils` is deprecated since NumPy 1.23.0, as a result
of the deprecation of `distutils` itself. It will be removed for
Python >= 3.12. For older Python versions it will remain present.
It is recommended to use `setuptools < 60.0` for those Python versions.
For more details, see:
https://numpy.org/devdocs/reference/distutils_status_migration.html
from numpy.distutils.core import setup
Traceback (most recent call last):
File "<string>", line 2, in <module>
File "<pip-setuptools-caller>", line 34, in <module>
File "/tmp/pip-install-7zl2qyty/lap_41e8804da0774145badb87ffc4023c16/setup.py", line 236, in <module>
setup_package()
File "/tmp/pip-install-7zl2qyty/lap_41e8804da0774145badb87ffc4023c16/setup.py", line 223, in setup_package
from numpy.distutils.core import setup
File "/home/firefly/miniconda3/envs/rk/lib/python3.9/site-packages/numpy/distutils/core.py", line 24, in <module>
from numpy.distutils.command import config, config_compiler, \
File "/home/firefly/miniconda3/envs/rk/lib/python3.9/site-packages/numpy/distutils/command/config.py", line 19, in <module>
from numpy.distutils.mingw32ccompiler import generate_manifest
File "/home/firefly/miniconda3/envs/rk/lib/python3.9/site-packages/numpy/distutils/mingw32ccompiler.py", line 27, in <module>
from distutils.msvccompiler import get_build_version as get_build_msvc_version
ModuleNotFoundError: No module named 'distutils.msvccompiler'
[end of output]
note: This error originates from a subprocess, and is likely not a problem with pip.
ERROR: Failed building wheel for lap
Running setup.py clean for lap
Failed to build lap
ERROR: ERROR: Failed to build installable wheels for some pyproject.toml based projects (lap)
可以尝试指定特定版本的包:
~/miniconda3/envs/rk/bin/pip install setuptools==59.5.0 -i https://pypi.tuna.tsinghua.edu.cn/simple/
~/miniconda3/envs/rk/bin/pip install numpy==1.26.1 -i https://pypi.tuna.tsinghua.edu.cn/simple/
~/miniconda3/envs/rk/bin/pip install lap -i https://pypi.tuna.tsinghua.edu.cn/simple/