Python Forum
python and openCV installation
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
python and openCV installation
#11
Nope:
C:\>pip install opencv-python --upgrade
Requirement already up-to-date: opencv-python in c:\users\jost\appdata\local\programs\python\python38\lib\site-packages (4.2.0.34)
Requirement already satisfied, skipping upgrade: numpy>=1.17.3 in c:\users\jost\appdata\local\programs\python\python38-32\lib\site-packages (from opencv-python) (1.19.0)

C:\>python
Python 3.8.1 (tags/v3.8.1:1b293b6, Dec 18 2019, 22:39:24) [MSC v.1916 32 bit (Intel)] on win32
Type "help", "copyright", "credits" or "license" for more information.
>>> import cv2
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "C:\Users\Jost\AppData\Local\Programs\Python\Python38\Lib\site-packages\cv2\__init__.py", line 3, in <module>
    from .cv2 import *
ModuleNotFoundError: No module named 'cv2.cv2'
>>>
Wall

Since I have no clue what the problem could be: here's a desperate list of software that is currently installed that potentially might cause conflicts:
  • Anaconda3 3030.02 (Python 3.7.6, 64bit)
  • Python Launcher
  • Python 3.6.6 (64bit)
  • Python 3.7.5 (64bit)
  • Python 3.8.1 (64bit)
  • Cmake
  • Microsoft Visual C++ (various versions)
  • Microsoft Visual Studio installer
  • NVidia Cuda Development (various versions)
  • NVidia Cuda Runtime (various versions)
  • Sublime Text 3
  • ...

Anything i should remove?
Reply
#12
I think you most remove this version.
c:\users\jost\appdata\local\programs\python\python38\
Try uninstall if not see it or always go into folder c:\users\jost\appdata\local\programs\python
Then delete folder python38,so only python38-32 folder is there.
Restart try again.

All goes wrong uninstall all Python versions and remove folders.
The can also choose a simpler path i always use simple path as eg C:\Python38\.
I don't like the long default Path,as i mention in tutorial here.

Also know that 64-bit version may be needed Download Windows x86-64 executable installer as many libaires in Opencv Data Science space requires it to use all optimizations.
Example look at this post,so example Taichi would not work with 32-bit.
So python38-32 means that's it's 32-bit.
Reply
#13
All went wrong... so I deinstalled all python versions, deleted all folders and installed once more, this time using the "python-3.7.8-amd64.exe". And Yes, I checked the "add to path" option.

And voila: at last one big step towards a working environment:
C:\>pip -V
pip 20.1.1 from c:\users\jost\appdata\local\programs\python\python37\lib\site-packages\pip (python 3.7)

C:\>pip install opencv-python
Collecting opencv-python
  Using cached opencv_python-4.2.0.34-cp37-cp37m-win_amd64.whl (33.0 MB)
Collecting numpy>=1.14.5
  Downloading numpy-1.19.0-cp37-cp37m-win_amd64.whl (13.0 MB)
     |████████████████████████████████| 13.0 MB 3.3 MB/s
Installing collected packages: numpy, opencv-python
Successfully installed numpy-1.19.0 opencv-python-4.2.0.34

C:\>python
Python 3.7.8 (tags/v3.7.8:4b47a5b6ba, Jun 28 2020, 08:53:46) [MSC v.1916 64 bit (AMD64)] on win32
Type "help", "copyright", "credits" or "license" for more information.
>>> import cv2
>>> cv2.bilateralFilter
<built-in function bilateralFilter>
Wow. Almost there!!!

Almost, because:
>>> cv2.adaptiveBilateralFilter
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
AttributeError: module 'cv2.cv2' has no attribute 'adaptiveBilateralFilter'
>>>
According to my thread here, , the adaptiveBilateralFilter should be in the opencv Version 4.2.
Reply
#14
Looks okay now,you could have gone for 3.8 version Wink
(Jul-03-2020, 10:31 AM)dejhost Wrote: According to my thread here, , the adaptiveBilateralFilter should be in the opencv Version 4.2.
No it's was removed in version 2.4 removed ABF from 2.4 because of low quality
Reply
#15
That's a shame!
It also means that there was no reason for me at all to mess up my setup - and create all these troubles... Wall

Well, thank you very much for your efforts Snippsat - very much appreciated!!!


In case s.b. has an alternative implementation of the adaptive bilateral filter, please share!
Reply
#16
Python and OpenCV installation for Windows Users

In today’s real time system, OpenCV plays a vital role. Basically, it is a big open-source library that is used for machine learning, computer vision and image processing. It enables us to process the images and videos to identify faces, objects, and even human handwriting. Having it integrated with various libraries like Numpuy, Python can process OpenCV array structure for analysis.
Here’s how you can install it:
● Press Windows+R
● Open Command Line (search for cmd in the Run dial)
● In case, python is already installed, then run ‘python --version.’
● If python is not installed, then before the installation process, you need to download it.
Downloading and Installing Python:
● All versions of Python for Windows are available on python.org. Visit the website and download the latest version.
● Once downloaded, begin the installation
● Install the libraries.
● Then install pip and other features.
● Finish the installation, to verify the installation, enter ‘python’ in your command terminal.
Downloading and Installing OpenCV
● OpenCV can be downloaded and installed by using pip (package manager). To install it, go to the command-line and type a command: ‘pip install opencv-python.
● Collect Information and download the data.
● Install Packages.
● Finish Installation.
● Run the following commands to perform a version check for OpenCV:

Python

>>>import cv2
>>>print(cv2.__version__)
Reply
#17
@princetonits this Thread is solved.
What you post is not related to error,it was OS Path problem with 2 Python version problem.
I have seen you done in other post to,so read what the Thread is about or your posts will be deleted.
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  Problem with using opencv in python Raunak1023984765 21 1,410 Feb-21-2024, 04:25 PM
Last Post: Pedroski55
  Python installation for old MacOS Yonix 1 457 Sep-21-2023, 03:32 PM
Last Post: menator01
  Installation of packages to newest Python version from previous one Andrzej_Andrzej 3 780 Jul-15-2023, 11:32 AM
Last Post: snippsat
  How to see the date of installation of python modules. newbieAuggie2019 4 1,464 Mar-31-2023, 12:40 PM
Last Post: newbieAuggie2019
  Getting "SSL client not supported by this Python installation" error prabirsarkar 0 915 Mar-13-2023, 05:01 PM
Last Post: prabirsarkar
  python installation/running inside singularity container erdemath 2 1,689 Sep-21-2022, 08:13 AM
Last Post: erdemath
Question Python V3.11 Installation Help Danno 2 1,053 Aug-11-2022, 02:30 AM
Last Post: Danno
  Help for the shortest way to install a suitable version of Python, Numpy, and OpenCV. Ezzat 2 2,226 Dec-23-2021, 12:34 PM
Last Post: snippsat
  Python OpenCV window not opening in fullscreen mode Zman350x 0 3,230 Apr-29-2021, 07:54 PM
Last Post: Zman350x
  Portable installation of Python possible? pstein 2 3,003 Nov-15-2020, 12:14 PM
Last Post: snippsat

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020