Add a new User Variable to point to the OpenCV (either x86 for 32-bit system or 圆4 for 64-bit system.) I am currently on a 64-bit machine.Īppend %OPENCV_DIR%\bin to the User Variable PATH.įor example, my PATH user variable looks like this.īefore: F:\Users\Johnny\Anaconda C:\Users\Johnny\Anaconda\ScriptsĪfter: F:\Users\Johnny\Anaconda C:\Users\Johnny\Anaconda\Scripts %OPENCV_DIR%\bin Right-click on "My Computer" (or "This PC" on Windows 8.1) -> left-click Properties -> left-click "Advanced" tab -> left-click "Environment Variables." button. BUT, we still need to do a little bit more work to get FFMPEG (video codec) to work (to enable us to do things like processing videos.) To this Anaconda directory (the beginning part might be slightly different on your machine): F:\Program Files\Anaconda2\Lib\site-packagesĪfter performing this step we shall now be able to use import cv2 in Python code. Our goal is to copy and paste the cv2.pyd file to this directory (so that we can use the import cv2 in our Python codes.).įrom this OpenCV directory (the beginning part might be slightly different on your machine): # Python 2.7 and 64-bit machine: F:\opencv\build\python\2.7\圆4 # Python 2.7 and 32-bit machine: F:\opencv\build\python\2.7\x84 F:\Program Files\Anaconda2\Lib\site-packages in my case) contains the Python packages that you may import. The Anaconda Site-packages directory (e.g.
0 Comments
Leave a Reply. |