Sei sulla pagina 1di 2

How To D.I.

Y: Installing OpenCV with python (with Numpy x64)


Installing Python for operating system with x64 is quite challenging. In official site
of numpy.org, there is no available version for x64.
In this case, I want use Python for my OpenCV 3.0. Inside the build folder only
available for Python 27. Thus I will use Python version 2 which is Python
2.7.10rc1 that available at Windows x86-64 MSI installer. This Python operate for
x64 system, FYI.
Here I will show an easy way to deal with the Numpy. You can also go to my
YouTube Channel.https://youtu.be/rT7wx5RQYCw
Step:

1. Install OpenCV 3.0 at http://opencv.org/downloads.html and extract to your


prefer file. (You can refer to my previous post on how-to-diy-installing-opencvwith...)
2. Install Python 2.7.10rc1. There is no much thing or problem during installation
as it only a simple setup & only take few minutes.
3. Next, go to http://www.lfd.uci.edu/~gohlke/pythonlibs/#numpy and
getnumpy-1.9.2+mkl-cp27-none-win_amd64.whl. (this .whl file is specialized
for Python27 and X64 system; as you can see the file name - cp34 is for
Python version 3.4, win32 for x32 system, etc).
4. However, to install .whl we need get-pip.py. Just click the link and download
get-pip.py from that page.
5. Now, go to your OpenCV file. Go to Build file, then inside there there is Python
file. Click 2.7. Click on x64 & copy "cv2.pyd" into C:\Python27\Lib\sitepackages (this is my own Python27 directory. It vary, depend on where you
save your folder. (this is my OpenCV directory
"C:\OPENCV30\opencv\build\python\2.7\x64").
6. After that, you have to copy the .whl file that you previously download. Paste
the .whl into C:\Python27\Scripts.

7. Now the important step is open your "Command Prompt".


8. Change directory by insert the command cd Downloads. It is where you
download your get-pip-py.
9. Now, insert command get-pip.py to run it.
10. As you can see, inside C:\Python27\Scripts, there is some files (pip, pip2.7,
pip2).
11. So, execute pip2.7.exe & you will obtain command list for your reference. You
can see every command must start with pip <command> <.....>.
12. Now insert pip install "numpy-1.9.2+mkl-cp27-none-win_amd64.whl" .
13. After done installing, now you already have files for Numpy. You can check
in C:\Python27\Lib\site-packages.
14. Now, open Python Idle. 1st insert import numpy then if there is no error
insert import cv2.
15. If there is no error, now you have successfully set everything for your OpenCVPython.
16. Since I unable to include image in this blog due to some error, I advice you to
click this youtube python-opencv for clearer explanation.

Potrebbero piacerti anche