Configure python and opencv and pythonopencv in 64-bit windows 8.1

Source: Internet
Author: User

Configure python and opencv and pythonopencv in 64-bit windows 8.1
Previously, python, opencv, and related libraries were installed in linux and can be directly operated through command lines. Recently, I need to configure python and opencv in windows. I checked some information and found that there are many configurations on the Internet. However, due to different versions, the versatility of many references is not good, the description is relatively simple. All the following steps are organized here, hoping to provide some reference functions. Python is installed first, and the subsequent steps are not strictly followed. 1. Install python2.7.xpython.org to download python2.7.X from the official website. I use 2.7.10 (pip comes with version 2.7.9 and later) and put python-related folders into system environment variables. C: \ Python27 // you can directly run pythonC: \ Python27 \ LibC in cmd/powershell: \ Python27 \ Scripts // you can directly run pip 2 in cmd/powershell and install numpy (python version of opencv requires this module). There are many numpy versions, it is suitable for different python versions (python2.6/2.7/3 *). Different system digits (win32/win_amd64) may cause some problems when downloading and installing sorceforege directly, if you cannot find the appropriate amd64 Installation File, download the package, and set the motor. py does not respond, and it is a flash. We recommend that you use pip to install the numpy wheel file. (pip comes with version 2.7.9 and later.) to install the wheel file, first install the wheel package. Enter the command pip install wheel in cmd/powershell. If the pip command is not found, check whether the pip folder is successfully installed in the environment variable, find the wheel file http://www.lfd.uci.edu that fits your system digits and python version numbers in the following URLs /~ Gohlke/pythonlibs/# numpy move to the place where the. whl file is stored in cmd/pwoershell. Then input pip install numpy into 1.10.4 + mkl into cp27 then none else win_amd64.whl and the result is as follows: Verify: Enter python >>> import numpy in cmd if no error is reported. 3. install and configure opencv to download the opencv address, for example, export-> python-> 2.7-> copy the file cv2.pyd under x86/x64 to python2.7 \ Lib \ site-packages for verification: cmd input python
>>>> Import cv2 is correct if no error is reported. 4. Test and then play happily under the opencv directory, such as sources \ samples \ python \ find demo. py and you can see the descriptions of each example. You can run the test to view the effect.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.