Error while installing cv2 in pycharm - python 3.5.3
Solution 1
The package name is actually opencv-python
. So you should do:
pip install opencv-python
However, the package is only available on pypi for version 3, not for version 2. I think the misunderstanding could come from when you are actually importing the package you do:
`import cv2`
But that is actually not the package name on pypi. See the documentation on pypi for more details.
Solution 2
In pycharm go to :
- File
- Settings
- Expand Project : [your project name]
- Select "project Interpreter"
-
In the top right corner of the grid listing the packages, click the green plus button A popup "Available packages" will appear
If no package is available in the list in the left, click the "Manage repositories" button, add this package URL (https://pypi.python.org/simple), then restart pycharm (You may also need to update pycharm to the lastest version, there was a bug here)
In the search box type "opencv-python"
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
Related videos on Youtube
![Ayyswariyaa](https://i.stack.imgur.com/KfwgA.jpg?s=256&g=1)
Ayyswariyaa
Hello, I am a Software Developer and loves to do something creative, love to learn and gain knowledge in anything new to me and also share my knowledge and help/guide others through teaching and now in the process of figuring out my highest potential and interested paths to choose as a developer. I have gained knowledge on Java, Spring Boot, REST Web services, and now venturing into Web Development and learning about JavaScript,J Query,NodeJS,ExpressJS,Mongoose Db. My next goal is to create my own website with the knowledge I have acquired and hope to gain more insight and learn new things during this journey.And with the experience hope to find a job which suits me best and have a fulfilling career..!! I may not have enough experience hands-On as a developer, but I believe that I can learn and work better with the knowledge that I already possess with some proper guidance :)
Updated on May 28, 2022Comments
-
Ayyswariyaa about 2 years
I am getting error while installing cv2 package from project interpreter.
Error occured: Non zero exit code(1)
When I execute command, pip install cv2..it gives error as,
Could not find a version that satisfies the requirement cv2(from versions: )No matching distribution found for cv2
Please help me solve this error.
-
Ayyswariyaa over 6 yearsI am getting this error when I try to run the command pip install opencv-python. Could not find a version that satisfies the requirement opencv-python(from versions: )No matching distribution found for opencv-python
-
yanxun over 6 yearsHmm, that's weird, because I am successful in downloading it. If you are using PyCharm, have you tried searching and downloading from Pycharm's Project Interpreter interface?
-
Ayyswariyaa over 6 yearsIt says run from system terminal.Make sure that you use the correct version of pip installed for your python interpreter located at /usr/bin/python3.5
-
yanxun over 6 yearstry updating your pip,
pip install --upgrade pip
-
Ayyswariyaa over 6 yearsI tried everything..It gives the same error for most of the packages
-
yanxun over 6 yearsMaybe your pip was installed for the wrong python? Try this stackoverflow.com/questions/25607837/…
-
Ayyswariyaa over 6 yearsI gave export $PATH=/usr/bin/python3.5:$[PATH].. It says not a valid Identifier
-
yanxun over 6 yearstry
export PATH=/usr/bin/python3.5:$[PATH]
-
yanxun over 6 yearsyup, it doesn't show any output because it is adding a new path into your $PATH variable, now try
echo $PATH
to see if your Python path is added into $PATH. -
Ayyswariyaa over 6 yearsOh ok..let me try.