Pycharm/Python OpenCV and CV2 install error

what is cv2 python
install cv2 python mac
how to install opencv in pycharm
install cv2 python ubuntu
could not find a version that satisfies the requirement opencv-python
no module named cv2
cv2 version
pip install opencv-python failed

I've been trying to install both OpenCV and cv2 from both Pycharm and from the terminal as suggested using:

pip install --user opencv
pip install --user cv2

but I'm getting the following error for them:

Collecting opencv
  Could not find a version that satisfies the requirement opencv (from versions: )
No matching distribution found for opencv

and

Collecting cv2
  Could not find a version that satisfies the requirement cv2 (from versions: )
No matching distribution found for cv2

How can I fix these and install the packages properly? I'm using python 3.4.

You are getting those errors because opencv and cv2 are not the python package names.

These are both included as part of the opencv-python package available to install from pip.

If you are using python 2 you can install with pip:

 pip install opencv-python

Or use the equivilent for python 3:

pip3 install opencv-python

After running the appropriate pip command your package should be available to use from python.

Error while installing cv2 module in pycharm, Today I installed openCV2.4 (and module cv2).I can import cv2 when I use python from terminal, but I imported cv2 and run on cv2 and run on Pycharm, an error occurred “no module named cv2”. http://stackoverflow.com/questions/​18672087/autocomplete-for-opencv-python-in-windows-not-working. Select the "opencv-python" package in the list and click the "Install Package" button in the bottom left of the popup Now go back to your code, it will no longer comply about the missing cv2 share | improve this answer answered Mar 19 '18 at 21:14

I ran into the same problem. One issue might be OpenCV is created for Python 2.7, not 3 (not all python 2.7 libraries will work in python 3 or greater). I also don't believe you can download OpenCV directly through PyCharm's package installer. I have found luck following the instructions: OpenCV Python. Specifically:

  1. Downloading and installing OpenCV from SourceForge
  2. Copying the cv2.pyd file from the download (opencv\build\python\2.7\x64) into Python's site-packages folder (something like: C:\Python27\Lib\site-packages)
  3. In PyCharm, open the python Console (Tools>Python Console) and type:import cv2, and assuming no errors print cv2.__version__

Alternatively, I have had luck using this package opencv-python, which you can straightforwardly install using pip with pip install opencv-python

Good luck!

How to import cv2 module in Pycharm? – IDEs Support (IntelliJ , failed on window. C:>pip install opencv-python. Collecting opencv. Could not find a version that satisfies the ) No matching distribution found for  Pycharm/Python OpenCV and CV2 install error; opencv cv2.calibrateCamera error; Python openCV 2.4.3 cv2.SolvePnP error; OpenCv cv2.arcLength(cnt,True) and cv2.contourArea(cnt) error; OpenCV Python cv2.perspectiveTransform; OpenCV Python cv2.mixChannels() Python+OpenCV: cv2.imwrite

python3.6 -m pip install opencv-python

will install cv2 in python3.6 branch

what's cv2 and how to install it (i had run 'pip install cv2 --user , Pycharm import still not happy (but almost there) #91 Create a new project, install cv2 with pip install opencv-python , try to import and Hi, I think I've localized the problem in the file my_project/my_venv/cv2/cv2/__init__.py. I'm trying to install the cv2 module on pycharm but I end up with the following error: In Python ,After installing pip Install python-opencv module , still the

Try this. I am using Jupyter notebook (OS: Ubuntu 16.04 LTS on Google Cloud Platform + on Windows). Executed following command in the Jupyter notebook to install opencv:

!pip install opencv-contrib-python    #working on both Windows and Ubuntu

After successful installation you will get following message:

Successfully installed opencv-contrib-python-4.1.0.25

Now restart the kernel and try to import opencv as:

import cv2

The same command can be used to installed opencv on Windows as well.

SOLUTION 2: try following commands to install opencv: For Ubuntu: Run following command from terminal:

sudo apt-get install libsm6 libxrender1 libfontconfig1

Restart Jupyter notebook kernel and execute following command:

!pip install opencv-contrib-python

NOTE: You can run all the above commands from the terminal as well without using '!'.

skvark/opencv-python, Maybe It's did't install by pip. How can I solve this problem? OpenCV Version: 3.0​.0 Pycharm Version: Conmunity Edition 2016.2.3 OS : Windows 7 64bit. Do you have both python 2.7 and 3.5 installed? If so, make sure that  In my case I thought I had the same issue too, after installing it it can't resolve anything about the module: but if I actually hit run anyway it works, maybe it has issue to autocomplete because opencv really comes as a compiled library (and for performace reason it makes sense) and doesn't have many python files, I found this comment related to a windows installation:

here is a tutorial that worked for me without any problem.

Copied from the site above the important part:

Download the OpenCV version corresponding to your Python installation from here. In my case, I’ve used opencv_python-3.1.0-cp35-cp35m-win32.whl.

Now, open a cmd window like before. You can open this directly in your Downloads folder if you SHIFT and right click inside it. The idea is to open a cmd window where you’ve downloaded the above [...] file. Use the [...] command to install [...] OpenCV:

1     pip install "opencv_python-3.1.0-cp35-cp35m-win32.whl"

Additional note: don't forget to change the name of the downloaded file in the command you use. Apparently by installing opencv, you'll have access to cv2 too.

no module named cv2 in Pycharm, In this tutorial. We will learn to setup OpenCV-Python in your Windows system. import cv2 as cv Problem is that, there is no official 64-bit binaries of Numpy. For Anaconda do: [code]conda install opencv Fetching package metadata .. Solving package specifications: . Package plan for installation in environment ~/anaconda/envs/Py3: The following NEW packages will be INSTALLED: hdf5: 1.8.1

Install OpenCV-Python in Windows, I've been trying to install both OpenCV and cv2 from both Pycharm and from the terminal as suggested using: pip install --user opencv pip  Last part in setting up Pycharm for OpenCV

How to use Cmake to build and install OpenCV and Extra Modules , This article shows you how to: Install OpenCV master, and contrib files from source Check to see where this process has installed the cv2.xxx.so file created is recognised by Python; Configure OpenCV in Pycharm, so that the Pycharm IDE This caused the whole openCV 'cmake' build process to fail. I tried updating python, reinstalling pip, reinstalling opencv-contrib-python ( which threw me an error: 'ImportError: cannot import name main '. In Pycharm, I went to settings, Project Interpretor>Add>opencv-contrib-python and I also have opencv-python installed. Why do I still get an AttributeError?

Collecting cv2 Could not find a version that satisfies the requirement , Pycharm/Python OpenCV and CV2 install error. the reason: Know the reason is really dumb, because the reason is that the package of CV2 is not called cv2 but​  Understand how to create your own Python programs. Join Over 50 Million Students Already Learning Online With Udemy

Comments
  • If you are on Ubuntu try sudo apt-get install python3-opencv
  • This answer worked for me on Mac OS.
  • You should accept an answer
  • This answer worked for me on Raspberry Pi 3B
  • This is the correct answer to the question see stackoverflow.com/a/39308557/281545 below too - why was flagged as a no answer in the review is beyond me
  • Note that depending on how your python installations are set-up pip install package-name might install it for python3, and you'd need to do pip2 to get installed for python 2.x. pip should match whatever python does from the command line.