在装有 python 3.13.1 的 Windows 上,当运行 pip install 某些东西(aeneas)时,我无法解决:您必须先安装 numpy,然后再安装 aeneas
我尝试过许多不同的方法,包括关注有关此事的旧 stackoverflow 帖子。
我希望这种方法至少能够奏效:
python -m venv myenv
.\myenv\Scripts\Activate
pip install numpy
pip list
Package Version
------- -------
numpy 2.2.1
pip 24.3.1
pip install aeneas
Collecting aeneas
Using cached aeneas-1.7.3.0.tar.gz (5.5 MB)
Installing build dependencies ... done
Getting requirements to build wheel ... error
error: subprocess-exited-with-error
× Getting requirements to build wheel did not run successfully.
│ exit code: 1
╰─> [3 lines of output]
[ERRO] You must install numpy before installing aeneas
[INFO] Try the following command:
[INFO] $ sudo pip install numpy
[end of output]
note: This error originates from a subprocess, and is likely not a problem with pip.
error: subprocess-exited-with-error
pip install setuptools
pip install --upgrade pip setuptools wheel
pip install --no-build-isolation aeneas
...You must install numpy before installing aeneas
最后两个命令是正确的,只是包比较旧并且需要
numpy.distutils
。这意味着它需要numpy
版本 1 而不是 2。numpy.distutils
在 python 3.12 中也被删除了。因此解决方案是使用 Python 3.11 和:在 Windows 上运行时我运气更好
因为它减少了潜在的路径问题,并确保你为你的python使用了正确的pip
你能尝试一下吗?