本文介绍了如何在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:\ opencv \ build \ python \ 2.7 \ x86文件夹并复制cv2.pyd文件.
  6. 转到C:\ Python27 \ DLLs目录并粘贴cv2.pyd文件.
  7. 转到C:\ Python27 \ Lib \ site-packages目录,然后粘贴cv2.pyd文件.
  8. 转到PyCharm IDE,然后转到DefaultSettings> PythonInterpreter.
  9. 选择已在Step1上安装的Python.
  10. 在pycharm中安装numpy,matplotlib和pip软件包.
  11. 重新启动您的PyCharm.
  12. PyCharm现在已安装并正在运行OpenCV库.
  1. Install Python 2.7.10
  2. Install Pycharm(If you have not done it already)
  3. Download and install the OpenCV executable.
  4. Add OpenCV in the system path(%OPENCV_DIR% = /path/of/opencv/directory)
  5. Goto C:\opencv\build\python\2.7\x86 folder and copy cv2.pyd file.
  6. Goto C:\Python27\DLLs directory and paste the cv2.pyd file.
  7. Goto C:\Python27\Lib\site-packages directory and paste the cv2.pyd file.
  8. Goto PyCharm IDE and goto DefaultSettings>PythonInterpreter.
  9. Select the Python which you have installed on Step1.
  10. Install the packages numpy,matplotlib and pip in pycharm.
  11. Restart your PyCharm.
  12. PyCharm now has OpenCV library installed and working.

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

10-30 03:39