简体   繁体   中英

Not able to install Python with OpenCV on windows x64 system

I am trying to install python on my system but facing some issues.

I have installed OpenCV 3.0.0 for Windows x64 bit system and now i am trying to install python 2.7.5 on my system and i also have installed numpy 1.7.1.

Then i copied 'cv2.pyd' from my OpenCV folder to python folder, now in order to configure them i have to import cv2 file but this error is coming when i try that.

在此处输入图片说明

can anyone help me in this i am new in this. Shall i try to work with latest version of python and numpy for my windows x64 system?

Thanks

Here's a complete way of installing OpenCV with Python

  1. Download: Python-2.7.11 from https://www.python.org/downloads numpy-1.8.0-win32-superpack-python2.7.exe from https://sourceforge.net/projects/numpy/files/NumPy/1.8.0/ matplotlib-1.3.0.win32-py2.7.exe from https://sourceforge.net/projects/matplotlib/files/matplotlib/matplotlib-1.3.0/
  2. Install Python-2.7.11
  3. Copy the .exe of numpy, matplotlib and opencv and paste them in C:\\Python27
  4. Run numpy-1.8.0-win32-superpack-python2.7.exe
  5. Run matplotlib-1.3.0.win32-py2.7.exe
  6. In Python Idle, execute import numpy to ensure that numpy is correctly installed.
  7. Run opencv-3.1.0.exe
  8. Goto opencv/build/python/2.7/x86 folder. Copy cv2.pyd to C:/Python27/lib/site-packeges.
  9. copy ffmpeg zip folder to C:\\
  10. Extract ffmpeg in C:\\ffmpeg
  11. Copy extracted ffmpeg folder to C:\\Python27
  12. Locate opencv_ffmpeg310_64.dll and opencv_ffmpeg310.dll and copy these at C:\\Python27 (Most likely opencv_ffmpeg310.dll is more important than opencv_ffmpeg310_64.dll but not sure. So copy both.)
  13. Go to system Variables and set path C:\\Python27; C:\\Python27\\ffmpeg\\bin

After lots of research and struggle i found out what the issue was.

My system is Windows x64 bit but this python and numpy most of the times don't work well with Windows x64 bit systems.

So i first i configured my OpenCV as x86, though my system is x64 bit. After that i download 32 bit python and numpy and configured the same with OpenCV and it worked very well.

Thanks !

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM