Need help for installing 'dlib' library - opencv

I've been trying to install dlib library for a while now and have tried almost all the solutions available on the web.
While installing this file I'm facing an error:
ERROR: dlib-19.7.0-cp36-cp36m-win_amd64.whl is not a supported wheel on this platform.
Help me. Any suggestions?

You need to install Cmake first as it is required for Dlib, get installation files from here or use pip install cmake.
Then install Anaconda 3.
Then run, pip install dlib to install dlib making sure that you're using python2, instead of python3.

Related

ERROR: No matching distribution found for psycopg2-binary==2.8.2

Please how should i install psycopg2-binary on my python image.
I tried pip install psycopg2-binary==2.8.2 but i got this error
ERROR: Could not find a version that satisfies the requirement psycopg2-binary==2.8.2 (from versions: 2.7.4, 2.7.5, 2.7.6, 2.7.6.1, 2.7.7, 2.8, 2.8.1, 2.8.2, 2.8.3, 2.8.4, 2.8.5, 2.8.6, 2.9, 2.9.1) ERROR: No matching distribution found for psycopg2-binary==2.8.2
My image is python3.9-alpine
What should i do please???
Given the amount of work that requires to be done, I suggest you use a different base image, e.g. python:3.9 or that you install the alpine package py3-psycopg2 (which is on v 2.8.6 at the time of writing).
Anyway I tried it on my machine and in the error it's also written Error: pg_config executable not found.
The pg_config is part of the postgres_dev package and needs to be installed before installing the psycopg2-binary package.
The psycopg2-binary will also need the gcc to be installed and some other libraries.
In other words, you have to execute the following commands:
apk add postgresql-dev gcc ...
pip install psycopg2-binary==2.8.2
I've abandoned the topic after I had to install a bunch of libraries.

How to install OpenCV 3.4.5 in Ubuntu 14.04?

I am trying to install OpenCV 3.4.5 in Ubuntu 14.04 LTS and I need this OS for my project. I have not found any proper way to do so. I tried this: https://docs.opencv.org/3.4.5/d2/de6/tutorial_py_setup_in_ubuntu.html but cannot install the dependencies as mentioned.
Any suggestions or guide would be much appreciated.
Assuming you have Python installed, try install opencv-python which is an unofficial pre-built OpenCV package.
pip install numpy
pip install opencv-python==3.4.5
To ensure successful installation, open IDLE to check version number:
import cv2
print(cv2.__version__)

Homebrew - Python3.7 replace Python3.6.5 if you brew install opencv2

I installed Python 3.6 using a direct link (brew install https://raw.githubusercontent.com/Homebrew/homebrew-core/f2a764ef944b1080be64bd88dca9a1d80130c558/Formula/python.rbbrew install https://raw.githubusercontent.com/Homebrew/homebrew-core/f2a764ef944b1080be64bd88dca9a1d80130c558/Formula/python.rb), since Brew now install by default 3.7 version, if I use brew install python3
Although if I install OpenCv2 from Brew; I get also Python 3.7, and that version get linked as default, moving 3.6 aside. I did try to brew link the previous version, but then when I import cv2, I get an error that the package does not exist.
If I run brew install opencv It tell me that the packages are already installed; so Python 3.6 can't import it, but 3.7 can.
I thought it is a problem with PATH but even that does not seem to have effect.
is there a way to tell brew to not update python when installing new packages? I am OK with 3.7 being installed; but I would like to be able to use OpenCV2 from both; while now I can only import it using 3.7 and not 3.6
brew pin python will prevent it from being upgraded. OpenCV will need to be installed with --build-from-source since the bottle is built and tested against the latest python formula.

libprotobuf fatal google/protobuf/stubs/common.cc:78 This program was compiled against version 2.6.1

I'm installing Opencv on Ubuntu with VMWARE following this website.
I finished installing opencv and at Step #6, I put import cv2 and got this error:
[libprotobuf fatal /home/psh/opencv-master/3rdparty/protobuf/src/google
/protobuf/stubs/common.cc:78] This program was compiled against version
2.6.1 of the protocol Buffer runtime library, which is not compatible
with the installed version(3.1.0)...
How can I fix it?
I don't know exactly What is the reason. But I got the same problem like you. But instead of fix this error. I try new way to install OpenCV.
And I follow steps in this website: http://milq.github.io/install-opencv-ubuntu-debian/
Run these commands
sudo apt-get install libopencv-dev python-opencv
sudo apt-get autoremove libopencv-dev python-opencv
Download this script and Run
source install-opencv.sh
After about 1-hour installation, we can test by:
python
import cv2
cv2.__version__
If you want to install OpenCV in your virtualenv too, follow step #5 at this tutorial (your tutorial)

"Could not find a version that satisfies the requirement opencv-python"

I am struggling with Jetson TX2 board (aarch64).
I need to install python wrapper for OpenCV.
I can do:
$ sudo apt-get install python-opencv
But I cannot do:
$ sudo pip install opencv-python
Is this because there is no proper wheel file in http://www.lfd.uci.edu/~gohlke/pythonlibs/#opencv?
Is there a way to install opencv-python through pip?
We were getting the same error.For us, it solved by upgrading pip version (also discussed in FAQ of OpenCV GitHub). Earlier we had pip-7.1.0, post upgrading it to "pip-9.0.2", it successfully installed.
pip install --upgrade pip
pip install opencv-python
pip doesn't use http://www.lfd.uci.edu/~gohlke/pythonlibs/, it downloads packages from PyPI.
The problem is that you have an unusual architecture; pip cannot find a package for it and there is no source code package.
Unfortunately I think you're on your own. You have to download source code from https://github.com/skvark/opencv-python, install compiler and necessary libraries and compile OpenCV yourself.
Use this and it will work:
pip install --upgrade pip
pip install opencv-python
Another problem can be that the python version you are using is not yet supported by opencv-python.
E.g. as of right now there is no opencv-python for python 3.8. You would need to downgrade your python to 3.7.5 for now.
It happened with me on Windows, pip was not able to install opencv-python==3.4.0.12.
Later found out that it was due to the Python version, Python 3.7 has some issue with not getting linked to https://github.com/skvark/opencv-python.
Downgraded to Python 3.6 and it worked with:
pip3 install opencv-python
I faced the same issue but the mistake which I was making was pip install python-opencv where I should have used pip install opencv-python. Hope this helps to anyone. It took me few hours to find.
As there is no proper wheel file in http://www.lfd.uci.edu/~gohlke/pythonlibs/#opencv?
Try this:(Worked in Anaconda Prompt or Pycharm)
pip install opencv-contrib-python
pip install opencv-python
A way to do this is to install Anaconda on your computer.
Then you should be able to do:
pip install opencv-python
or
conda install opencv
I had the same error. The first time I used the 32-bit version of python but my computer is 64-bit. I then reinstalled the 64-bit version and succeeded.
Install it by using this command:
pip install opencv-contrib-python
I faced same issue while using Python 3.9.0.
Upgrading python to latest version (currently 3.9.1) and reinstalling opencv-python solved this issue.
I got this error and I solved it by simply waiting.
I had similar problem:
ERROR: Could not find a version that satisfies the requirement opencv-contrib-python (from versions: none)
Command pip update was not resolving my issue.
After lunch-time I tried again and it installed correctly the package.
Maybe the server was down.
I update the version of python, and then the issue was addressed. Please refer to this video: https://www.youtube.com/watch?v=BQnpRbbEZB4

Resources