如何在 Windows 上安装 OpenCV 并在不使用包管理器的情况下为 PyCharm 启用它 [英] How to install OpenCV on Windows and enable it for PyCharm without using the package manager

查看:34
本文介绍了如何在 Windows 上安装 OpenCV 并在不使用包管理器的情况下为 PyCharm 启用它的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试安装和使用 OpenCV 库进行 Python 开发.我想将它用于 PyCharm IDE.我正在尝试在没有包管理器的情况下执行此操作.

I am trying to install and use OpenCV library for python development. I want to use it for PyCharm IDE. I am trying to do it without the package manager.

环境是windows 64位架构.对于 Python,我使用的是 Python 2.7.10.

The environment is a windows 64 bit architecture. For Python I am using Python 2.7.10.

我已经在系统路径中包含了 OpenCV 目录.

I have already included the OpenCV directory in the system path.

我正在为 PyCharm 使用 python 2.7.10 解释器,并且已经安装了 pip 和 numpy 包.

I am using python 2.7.10 interpreter for PyCharm and have installed the pip and numpy packages.

opencv 版本是 3.0.0

opencv version is 3.0.0

如何启用 OpenCV 并使其在 PyCharm 中工作?

How do I enable OpenCV and make it working in PyCharm?

推荐答案

我终于想出了如何解决这个问题:

I finally figured out on how to solve this issue:

要遵循的步骤:

  1. 安装 Python 2.7.10
  2. 安装 Pycharm(如果你还没有安装过)
  3. 下载并安装 OpenCV 可执行文件.
  4. 在系统路径中添加OpenCV(%OPENCV_DIR% =/path/of/opencv/directory)
  5. 转到 C:opencvuildpython2.7x86 文件夹并复制 cv2.pyd 文件.
  6. 转到 C:Python27DLLs 目录并粘贴 cv2.pyd 文件.
  7. 转到 C:Python27Libsite-packages 目录并粘贴 cv2.pyd 文件.
  8. 转到 PyCharm IDE 并转到 DefaultSettings>PythonInterpreter.
  9. 选择您在 Step1 上安装的 Python.
  10. 在 pycharm 中安装包 numpy、matplotlib 和 pip.
  11. 重启你的 PyCharm.
  12. PyCharm 现在已安装并运行 OpenCV 库.

这篇关于如何在 Windows 上安装 OpenCV 并在不使用包管理器的情况下为 PyCharm 启用它的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆