我使用python poetry(https://python-poetry.org/)在我的项目中进行依赖管理。
虽然当我运行poetry install
,它给我下面的错误。
ERROR: Failed building wheel for numpy
Failed to build numpy
ERROR: Could not build wheels for numpy, which is required to install pyproject.toml-based projects
我在我的笔记本电脑上安装了Python 3.9。
我使用pip install numpy
安装了numpy 1.21.5,我甚至试图将其版本降低到1.19.5。
虽然我得到了同样的错误。
我发现很多人在python 3.10中遇到ERROR: Failed building wheel for numpy
这个错误,他们通过将python版本降低到3.9来解决它,尽管这对我不起作用。
4条答案
按热度按时间qoefvg9y1#
我通过以下步骤解决了这个问题:
1.我用
pip install numpy
命令安装的numpy版本更新了pyproject.toml(这个文件包含所有的库/依赖项/dev依赖项)。1.运行
poetry lock
更新poetry.lock文件(包含库的详细信息)1.再次运行
poetry install
,它应该可以正常工作。pip install numpy==version
安装所需的版本。**示例:**安装NumPy 1.23.5版本,请使用-
pip install numpy==1.23.5
如果你有任何问题,你可以发表评论。我会试着回答。
htzpubme2#
我尝试在macOS上安装numpy和PyPy。
我通过首先运行
brew doctor
解决了这个问题,这表明我的命令行工具(XCode)已经过时了。然后我只是按照说明更新它们:这解决了问题。
我的配置:
ss2ws0br3#
我通过安装正确版本的numpy解决了这个问题,在这里检查兼容性https://matplotlib.org/stable/devel/min_dep_policy.html
然后通过pip 3 install -v numpy==[version]安装
cbeh67ev4#
Numpy错误解决
此错误原因是由于过时的numpy版本只需运行此命令
MATHLAB =“m”pip install numpy
”
**我的python版本:**Python -V=3.9
**如果你使用的是
venv
,那么尝试在venv中安装numpy。**然后运行你的代码,它将正常工作。