8

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.

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

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

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

opencv version is 3.0.0

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

webapp
  • 710
  • 1
  • 6
  • 16
  • Have you tried editing PYTHONPATH to include the directory that contains the OpenCV Python libraries? That is unless the default installation of OpenCV for Windows doesn't come with Python enabled in which case you need to build from source the whole think and make sure that CMake has this flags checked. PyCharm also uses PYTHONPATH so if the variable is set properly I see no reason why it shouldn't be working. Please provide more information on your setup. – rbaleksandar Sep 18 '15 at 20:10
  • Yes, I have already included the OpenCV directory in the system path. – webapp Sep 18 '15 at 20:19
  • I am using python 2.7.10 interpreter for PyCharm and have installed the pip and numpy packages. – webapp Sep 18 '15 at 20:20
  • opencv version is 3.0.0 – webapp Sep 18 '15 at 20:22
  • Edit your question and post this info there, not in the comment area. Also post the contents of your PYTHONPATH.. – rbaleksandar Sep 18 '15 at 20:52

3 Answers3

29

I finally figured out on how to solve this issue:

Steps to follow:

  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.
webapp
  • 710
  • 1
  • 6
  • 16
0

nothing hard.

➡If you’re using anaconda

conda install opencv

➡If you have python package manager pip

pip install opencv-python
0

If you are using pycharm you can easily install libraries like OpenCV, NumPy, pandas by using packages. To add and install a package go to File -> Settings -> Project. You can see the project name in front of the project. Click on it and in the left side you can see the already installed packages. Click the "+" button and search your package. Then You can install it and use it easily.

Package Installer

ManulMad
  • 92
  • 9