Make OpenCV3 available from python3 installed with pyenv

Since OpenCV3 could not be installed on anaconda (opencv 2.4.10 as of November 11, 2015). If you are not particular about opencv3, you can install it with the following command.

conda install -c https://conda.binstar.org/jjhelmus opencv

environment

Mac OS X 10.10.1 homebrew pyenv anaconda3-2.4.0 (installed by pyenv)

Introducing OpenCV 3

brew tap homebrew/science
brew install opencv3 --with-python3
brew link opencv3 --force

Make OpenCV3 available from python3

% cd /Users/(username)/.pyenv/versions/anaconda3-2.4.0/lib/python3.5/site-packages
% ln -s /usr/local/Cellar/opencv3/3.0.0/lib/python3.5/site-packages/cv2.cpython-35m-darwin.so cv2.so

Please change the path according to the version of anaconda or python. Also, for "cv2.cpython-35m-darwin.so", please look for something like that depending on your environment.

test

% python
Python 3.5.0 |Anaconda 2.4.0 (x86_64)| (default, Oct 20 2015, 14:39:26)
[GCC 4.2.1 (Apple Inc. build 5577)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> import cv2
>>> cv2.__version__
'3.0.0'
>>>

If there is no error when importing, the installation is successful ✨

Recommended Posts

Make OpenCV3 available from python3 installed with pyenv
Make MeCab available from Python3
Make Opencv available in Python
Install the latest Python from pyenv installed with homebrew
Image acquisition from camera with Python + OpenCV
Use Anaconda-Python installed with pyenv from openFrameworks
Binarization with OpenCV / Python
Install python with pyenv
Make JSON into CSV with Python from Splunk
Use Python installed with pyenv for PL / Python execution environment
Use python installed with Pyenv with Sublime REPL of Sublime Text 3
[Python] Using OpenCV with Python (Basic)
Make Puyo Puyo AI with Python
Make a fortune with Python
Reinstall python with pyenv with -fPIC
Face detection with Python + OpenCV
Install pyenv from Homebrew, install Python from pyenv
python with pyenv and venv
With skype, notify with skype from python!
Using OpenCV with Python @Mac
Cut out frames from video by 1 second with Python + OpenCV
A memorandum (masOS) that import tkinter could not be done with python installed from pyenv
TensorFlow 2.2 can't be installed with Python 3.8!
Shining life with Python and OpenCV
Make Echolalia LINEbot with Python + heroku
Call C from Python with DragonFFI
[Python] Using OpenCV with Python (Image Filtering)
Neural network with OpenCV 3 and Python 3
Using Rstan from Python with PypeR
[Python] Using OpenCV with Python (Image transformation)
Let's make a GUI with python.
Install Python from source with Ansible
Create folders from '01' to '12' with python
[Python] Using OpenCV with Python (Edge Detection)
Set python compile options with pyenv
python / Make a dict from a list.
Easy Python + OpenCV programming with Canopy
Make a recommender system with python
Run Aprili from Python with Orange
Try face recognition with python + OpenCV
Unable to install Python with pyenv
Use Python in pyenv with NeoVim
Cut out face with Python + OpenCV
Face recognition with camera with opencv3 + python2.7
Load gif images with Python + OpenCV
[Lambda] Make import requests available [python]
Call python from nim with Nimpy
Let's make a graph with python! !!
Find image similarity with Python + OpenCV
Use OpenCV with Python 3 in Window
Draw an illustration with Python + OpenCV
Read fbx from python with cinema4d
Track baseball balls with Python + OpenCV
Graph Based Segmentation with Python + OpenCV
[Python] Make pip available on macOS
Check installed modules from Python scripts
Draw arrows (vectors) with opencv / python
Basic study of OpenCV with Python
I couldn't use tkinter with python installed by pyenv of anyenv
Make a cat detector with Google Colabratory (Part 2) [Python] ~ Use OpenCV ~
How to make a surveillance camera (Security Camera) with Opencv and Python