I referred to the question:
python3 openCV install error: Symbol not found: _clock_gettime
that suggest as answer to either upgrade the OS, either install a former version of openCV that does not call for _clock_gettime:
ImportError: dlopen([path]/miniconda3/lib/python3.7/site-packages/cv2/cv2.cpython-37m-darwin.so, 2): Symbol not found: _clock_gettime
Referenced from: [path]/miniconda3/lib/python3.7/site-packages/cv2/.dylibs/libavutil.56.22.100.dylib
Expected in: /usr/lib/libSystem.B.dylib
in [path]/miniconda3/lib/python3.7/site-packages/cv2/.dylibs/libavutil.56.22.100.dylib
I tried to install the downgraded version of opencv from a conda channel :
conda install -n mlvision -c rpi opencv
(see : https://anaconda.org/search?q=opencv)
The error persist when using jupyter, instead from the console it works fine.
I think the problem is in reference to the right environment.
I did the following:
conda create mlvision
conda activate mlvision
# install packages on local env
conda install -n mlvision keras
conda install -n mlvision -c rpi opencv
I see that in the error above the python path does not point to the local conda environment.
I created another question because the referenced answer above did not solve my issue.
__
NB using miniconda, not anaconda.
Mac OS 1.9.5
You can try to install opencv from a different conda channel if you're not tied to rpi.
I would recommend going for conda-forge with conda install -c conda-forge opencv, or maybe default channels that should work with a simple conda install opencv.
Related
I am stuck on this installation of scikit-image (aka skimage). I tried multiple ways:
Installation from a git hub folder (using the requirements.txt)
Installation from a whl file
Installation with pip install scikit-image
All three trials failed during the import: import skimage
ImportError: cannot import name 'geometry'
It seems that scikit-image has not been built correctly.
Your install of scikit-image appears to be broken.
Try re-installing the package following the instructions at:
https://scikit-image.org/docs/stable/install.html
I went through internet but did not find solutions besides the ones above.
Does anyone went through that before?
One possibility seems to be to pip install with -egg, but I found that for Mac rather than Windows.
EDIT:
Hi everyone, so I found a solution but this is kind of very hard and I still don't understand why it did not work before.
I just:
uninstall anaconda
uninstall python
install python (3.8)
install Anaconda (I have trouble with Spyder now^^)
If you want to code for computer vision/Image processing/machine learning tasks, then it can be done in pycharm with conda environment very easily. There is no need to install python separately to run Anaconda.
First, download and install pycharm. Next, If you use windows then download Anaconda 64 bit python 3.7 version from here,
https://www.anaconda.com/distribution/#windows
You can find some details about managing environment and helpful links here,
How to create some environments for tensorflow in anaconda?
https://docs.conda.io/projects/conda/en/latest/user-guide/tasks/manage-environments.html
Create a conda environment first using Anaconda Prompt command line,
conda create -n cvenv python=3.7
Now activate that environment using. By default base is activated.
conda activate cvenv
Next, install the packages you want,
conda install -c conda-forge scikit-learn
conda install -c conda-forge scikit-image
conda install -c conda-forge pillow
conda install -c conda-forge opencv
I use conda-forge packages as they are more recent. Finally, open pycharm and create a new project by selecting existing python interpreter in conda environment. If none exists then select,
Browse > Add Python Interpreter > Conda Environment > Interpreter > Browse > Anaconda3 installation folder > envs folder > cvenv folder > Python.exe
You can test by creating a python file and writing import skimage.
I want to run keras on anaconda for convolution neural network using mnist handwriting recognition. A day before everything worked fine but as I try to run the same program, i get the following error in the first line:
from keras.datasets import mnist (first line of code)
ModuleNotFoundError: No module named 'keras.datasets'; 'keras' is not
a package
I also created virtual environment to use python 3.5 as my python version is 3.6. I have installed both keras and tensorflow. How do i fix the above error? Perhaps it is related to path and not error with keras. My anaconda is installed in E: whearas working environment is C:\Users\Prashant Mahato.
Do you get an error message if you just import keras? I was getting a similar error in the command line and then implemented in Spyder (using Anaconda) and it worked fine.
Here is how I install Keras and other related dependencies
conda create -n <Environment_Name> python=3.6
activate <Environment_Name>
conda update --all
conda install mingw libpython
conda install scipy
conda install numpy
conda install mkl
conda install -c conda-forge tensorflow
conda install theano
pip install pyyaml
pip install h5py
pip install keras
conda install -c conda-forge tmux
conda install pandas
condas install pillow
conda install scikit-learn
conda install -c menpo opencv3
To check if everything is work as it should just import all the packages in python within the environment created.
I'm running Windows 10 and Anaconda 4.2
If running Ubuntu, replace
activate <Environment_Name>
with
source activate <Environment_Name>
HTH.
Tried the following steps
conda install -c menpo opencv3=3.2.0 ..
Fetching package metadata....An unexpected error has occurred
Did some internet search and used conda config --set ssl_verify=False
Then tried doing conda update -all and conda update pyopenssl but no luck
even remove certifidoes not work ...gives the same error...infact any update / install attempt gives the same result.
I have NOT set my PYTHONHOME or PYTHONPATH
Followin are the screen shots of my current conda settings and the update/install error. Platform : Windows 8.1
If there is any other method to install OpenCV 3.2 in Anaconda environment please mention it
EDIT : PROBLEM SOLVED
Open Anaconda terminal
Navigate to the folder in Anaconda main folder which contains Python Scripts
Download the un-offical opencv + contrib binaries from here
In the Anaconda terminal do pip install
`
For anaconda running python 3.7, you can use
conda install py-opencv=3.4.2
The menpo file page shows only OpenCV 3.2.0 for Python 2.7/3.4/3.5 on linux-64 platform is available.
You can try this OpenCV 3.2.0 binary in github if your Windows is 64-bit and with Python 2.7.
See this https://stackoverflow.com/questions/42310099 for more informtion.
Also, you can go into your Anaconda environment and run one of the following for OpenCV 3.4.4:
conda install -c conda-forge opencv
conda install -c conda-forge/label/gcc7 opencv
conda install -c conda-forge/label/broken opencv
conda install -c conda-forge/label/cf201901 opencv
I was able to create a new environment using the anaconda navigator with python 3.5. It works for me in that environment.
I have installed Anaconda 64 bit on a relatively fresh install of Arch.
I followed the instructions here to set up a virtual environment for opencv:
conda create -n opencv numpy scipy scikit-learn matplotlib python=3
source activate opencv
conda install -c https://conda.binstar.org/menpo opencv3
When I run "import cv2" on the activated virtual environment I get:
ImportError: libselinux.so.1: cannot open shared object file: No such file or directory
I have no clue how to fix this - do I need to make kernel changes?
Thanks for any help.
Fixed with installing the libselinux package in the AUR:
yaourt -S libselinux
I now have another problem:
ImportError: /usr/lib/libpangoft2-1.0.so.0: undefined symbol: FcWeightToOpenType
Solved as in issue 368
conda install -c asmeurer pango
To solve this problem you can install the missing package with:
yaourt -S libselinux
I tried to install OpenCV on Anaconda
pip install cv2
pip install opencv
conda install opencv
conda install -c https://conda.binstar.org/jjhelmus opencv
(refered here Anaconda doesn't find module cv2)
but all failed. Does anybody know how to install this?
Run the following command:
conda install -c https://conda.binstar.org/menpo opencv
I realized that opencv3 is also available now, run the following command:
conda install -c https://conda.binstar.org/menpo opencv3
Edit on Aug 18, 2016:
You may like to add the "menpo" channel permanently by:
conda config --add channels menpo
And then opencv can be installed by:
conda install opencv(or opencv3)
Edit on Aug 14, 2017:
"clinicalgraphics" channel provides relatively newer vtk version for very recent python3
conda install -c clinicalgraphics vtk
I guess
http://answers.opencv.org/question/17536/install-opencv-for-anaconda-ipython/
it would be an answer
If you compile OpenCV from source, and Anaconda is your default python interpretor
(CMake rule PYTHON_PACKAGES_PATH = C:\Anaconda\Lib\site-packages),
then the install rule will copy cv2.pyd to C:\Anaconda\Lib\site-packages.
Otherwise, you could do it manually, and make sure OpenCV libs are in the PATH.
Still I don't know what is CMake rule(?) and "install rule".
Firstly go to your anaconda folder. The path in my case was -
C:\Users.....\Anaconda3 . Then go to the Scripts folder.
Open this link- http://www.lfd.uci.edu/~gohlke/pythonlibs/#opencv .
Download this file - opencv_python-3.2.0-cp36-cp36m-win_amd64.whl from the link and copy paste it into your Scripts folder inside Anaconda3 folder.
Now go to spyder and type this,
import cv2
If everything works out it wont show any error and congrats you just installed it successfully.
Anaconda Python OpenCV-----------------
Remove all previous/current (if any) python installation
Install Anaconda and add anaconda to PATH(Envirnoment variables:: Adavanced system setting->Environment variables->under system variables go to variable PATHand click edit to add new envirnomental variables)
(During installation check box involve PATH)
Open anaconda prompt with admin access. Type and enter:-
conda update --all
conda install -c conda-forge opencv (for opencv)
conda install spyder=4.0.0 (spyder updation)
conda update python (for python updation)