问题描述
我正在尝试安装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:
要遵循的步骤:
- 安装Python 2.7.10
- 安装Pycharm(如果尚未安装)
- 下载并安装OpenCV可执行文件.
- 在系统路径中添加OpenCV(%OPENCV_DIR%=/path/of/opencv/directory)
- 转到C:\ opencv \ build \ python \ 2.7 \ x86文件夹并复制cv2.pyd文件.
- 转到C:\ Python27 \ DLLs目录并粘贴cv2.pyd文件.
- 转到C:\ Python27 \ Lib \ site-packages目录,然后粘贴cv2.pyd文件.
- 转到PyCharm IDE,然后转到DefaultSettings> PythonInterpreter.
- 选择已在Step1上安装的Python.
- 在pycharm中安装numpy,matplotlib和pip软件包.
- 重新启动您的PyCharm.
- PyCharm现在已安装并正在运行OpenCV库.
- Install Python 2.7.10
- Install Pycharm(If you have not done it already)
- Download and install the OpenCV executable.
- Add OpenCV in the system path(%OPENCV_DIR% = /path/of/opencv/directory)
- Goto C:\opencv\build\python\2.7\x86 folder and copy cv2.pyd file.
- Goto C:\Python27\DLLs directory and paste the cv2.pyd file.
- Goto C:\Python27\Lib\site-packages directory and paste the cv2.pyd file.
- Goto PyCharm IDE and goto DefaultSettings>PythonInterpreter.
- Select the Python which you have installed on Step1.
- Install the packages numpy,matplotlib and pip in pycharm.
- Restart your PyCharm.
- PyCharm now has OpenCV library installed and working.
这篇关于如何在Windows上安装OpenCV并启用PyCharm而不使用包管理器的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!