gpt4 book ai didi

python - OpenCV 安装 : deprecation error

转载 作者:太空宇宙 更新时间:2023-11-03 21:31:58 25 4
gpt4 key购买 nike

我想将 opencv 与 python 一起使用,但我认为我的 numpy 版本有问题。如何确保 opencv 使用正确的 numpy 版本?

我做了

sudo pip install opencv-python

我收到了这条消息

Installing collected packages: numpy, opencv-python
Found existing installation: numpy 1.8.0rc1
DEPRECATION: Uninstalling a distutils installed project (numpy) has been deprecated and will be removed in a future version. This is due to the fact that uninstalling a distutils project will only partially uninstall the project.
Uninstalling numpy-1.8.0rc1:
Successfully uninstalled numpy-1.8.0rc1
Successfully installed numpy-1.14.5 opencv-python-3.4.1.15

现在当我尝试

import cv2

我明白了

ImportError: numpy.core.multiarray failed to import

我还用

更新了我的 numpy 版本
sudo pip install -U numpy

最佳答案

如果您在计算机上同时使用 Py2.7 和 3.5,请通过执行 python3 -m pip install numpy -I 确保安装了正确版本的 numpy或者 python2 -m pip install numpy -I

关于python - OpenCV 安装 : deprecation error,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/50900423/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com