Force python 3 install anaconda
![force python 3 install anaconda force python 3 install anaconda](https://i.stack.imgur.com/FmB2i.png)
home/yourself/anaconda3/envs/opencv340/lib/python3.6/site-packages Your site-packages directory should be located somewhere like: You then copy the cv2*.so from your opencv build directory to the site-packages of your anaconda environment. You'll then see that opencv pick the correct python, the one in the anaconda environment of which you gave the path of. DPYTHON_NUMPY_INCLUDE_DIR=/home/yourself/anaconda3/envs/opencv340/lib/python3.6/site-packages/core/include DPYTHON_PACKAGES_PATH=/home/yourself/anaconda3/envs/opencv340/lib/python3.6/site-packages \ DPYTHON_LIBRARY=/home/yourself/anaconda3/envs/opencv340/lib/libpython3.6m.so \ DPYTHON_INCLUDE=/home/yourself/anaconda3/envs/opencv340/include \ In the following example I have an opencv340 anaconda environment located in /home/yourself/anaconda3/envs/opencv340 and so I'll specifiy the above variables for cmake as follows: -DPYTHON_EXECUTABLE=/home/yourself/anaconda3/envs/opencv340/bin/python3 \
![force python 3 install anaconda force python 3 install anaconda](https://problemsolvingwithpython.com/01-Orientation/images/anaconda_python3_or_python2.png)
![force python 3 install anaconda force python 3 install anaconda](https://i.stack.imgur.com/s986L.png)
If you want to compile opencv against a specific anaconda environment, you can specify the PYTHON_EXECUTABLE, PYTHON_INCLUDE and PYTHON_LIBRARY, PYTHON_PACKAGES_PATH, PYTHON_NUMPY_INCLUDE_DIR variables in cmake. To see if you have installed it successfully, fire up your Python and issue the following command: import cv2 # import the opencv libraryĬv2._version_ # this will print the version of your opencv3 This should install OpenCV in your Anaconda. If the version of python install in your Anaconda is 2.7, the command above should install OpenCV 3.1, but if the version of your python is 3.5, then you should change 'opencv' in the last line to 'opencv3' conda install -c menpo opencv3 If you have the Anaconda python distribution installed in your system, you can issue this command (assuming you are working on linux) fire up the terminal: conda install -c menpo opencv I personally installed it myself so just try follow along with these instructions.
FORCE PYTHON 3 INSTALL ANACONDA HOW TO
I found this site which gives instruction on how to install opencv3 Tool called 'conda' that is available in your terminal once you have installed I think you don't need to build OpenCV for anaconda, there is this very handy So I suppose it build for the python2 version as stated in the last line. I can however import cv2 from builtin python2 command. īut after installing it I can't import cv2 within python3 of anaconda. I installed opencv with the following make options cmake -D CMAKE_BUILD_TYPE=RELEASE -D CMAKE_INSTALL_PREFIX=/usr/local -D WITH_TBB=ON -D BUILD_NEW_PYTHON_SUPPORT=ON -D WITH_V4L=ON -D INSTALL_C_EXAMPLES=ON -D INSTALL_PYTHON_EXAMPLES=ON -D BUILD_EXAMPLES=ON -D WITH_QT=ON -D WITH_OPENGL=ON -D ENABLE_FAST_MATH=1 -D CUDA_FAST_MATH=1 -D WITH_CUBLAS=1 -D CUDA_NVCC_FLAGS="-D_FORCE_INLINES". packages path: lib/python3.5/site-packages numpy: /home/tamim/anaconda3/lib/python3.5/site-packages/numpy/core/include (ver 1.11.1) Interpreter: /home/tamim/anaconda3/bin/python3 (ver 3.5.2) packages path: lib/python2.7/dist-packages numpy: /usr/lib/python2.7/dist-packages/numpy/core/include (ver 1.11.0) How do I install opencv with anaconda python3, opencv picked up my python3 executables - Python 2: