OpenCV don't show methods in Pycharm - python

I'm trying to install the OpenCV library, to be able to manipulate images, to install it, I'm using the command in prompt:
pip install opencv-python
But it doesn't work, in pycharm the methods I need do not appear, such as: "cv2.imread()" or "cv2.imshow()":
Pycharm IDE
Notes:
I'm using the python version 3.11.1
i'm using the OpenCv version 4.7.0.68
I'm coding in Windows plataform
I also tried using the command:
pip install opencv-contrib-python
I thought that would solve the situation, but it stayed the same

This will fix issue but roll you back to the previous version
pip install opencv-python==4.5.5.62
do this to return back to the latest version
pip install -U opencv-python

Related

Cannot install OpenCV in PyCharm GUI with Anaconda interpreter

I wanna install OpenCV module in GUI if it is possible.
But as following pictures, the search result doesn't show opencv-python and opencv-contrib-python modules.
Why this problem happens?
There is just no such a package in repositories used by conda package manager.
Running conda install opencv-python from the system terminal will fail for the same reason.
You can install it with pip though.
Click the following button to use pip instead of conda package manager and try again:

How to install pip Pygame1.9.5.dev0? [duplicate]

Currently unable to install Pygame via pip:
pip install pygame
Getting this message:
Concerned by it being termed an EOF error, is this an error in the module itself?
There's dev versions available as of now. Get them via
pip install pygame==2.0.0.dev6
Pygame is not compatible with Python 3.8 at the moment. I would recommend you to downgrade back to 3.7 and installing with pip there.
pip is doesn't have pygame up.
But there is a alternative that worked for me. https://www.pygame.org/wiki/CompileWindows
Read and follow the steps correctly and it should install.
you also need to update your code to pygame 2.0.0 code because it's only for 3.8
BTW you have to follow the SDL2 instructions since pygame 2.0.0 uses that.
the above commands worked for me today 3-15-20 with Python-3-8-0 on Linux Mint 19
to get IDLE to recognize pygame.
sudo pip3 install pygame==2.0.0.dev6
I also had to update pip first with
sudo pip3 install --upgrade pip
Pygame requires visual studio C++ build tools to install. Ensure you have these downloaded from here.
Open power shell window and make sure your internet is on
Then type the following command
pip install pygame
It will automatically download it for you and also install it
Again make sure your internet is on
I have python 3.8.2 and it worked on my pc

How to Upgrade OpenCV to Specific Version Using Pip?

I want to install OpenCV 3.4.0 on Ubuntu 16.04. I tried to build from source following tutorial on internet but run to this problem:
ImportError:
/home/ivan/.virtualenvs/cv/lib/python3.5/site-packages/cv2.so:
undefined symbol: _ZTIN2cv3dnn19experimental_dnn_v35LayerE
So I decided to just upgrade OpenCV using pip following solution on github https://github.com/CharlesShang/FastMaskRCNN/issues/111:
pip3 install --upgrade opencv-python
It works fine, cv2 successfully imported. But it directly upgraded to opencv 4.0.0 . Is there any way to upgrade opencv to specific version (ex: 3.4.0) using pip?
All you have to do is to put the version in the command as follows
pip3 install --upgrade opencv-python==3.4.0
Actually (in 2020) Opencv library is version 4.2.XX
so my suggestion:
pip3 install --upgrade opencv-python==4.2.34

Error on installing pywin32 modul for python 2.7

I`m disparately trying to install win32.client which I know is a part of pywin32 module.
I have tried with:
pip install
pip install and downloaded different versions of .whl files
.zip install from cmd (see pics bellow)
My version of python is : Info of my python version
When I tried with pip install:
I get this error
When I tried with pip install and downloaded .whl file:
I get this error
When I tried with .zip file:
enter image description here
Do someone has any ideea why is not working ?
I also uninstalled python and installed again
I suggest you uninstall from pip and install with the .exe installer from the official repository.
This has always worked for me. Remember to select the right version for your version of python.
You may try installing with:
conda install -c anaconda pywin32
But from the warning;
You can upgrade to a newer version of Python to solve this.
I would upgrade to python 3 and try again.

brew python versus non-brew ipython

I installed python via brew, and made it my default python. If I run which python, I obtain /usr/local/bin/python. Also pip is installed via brew, which pip returns /usr/local/bin/pip.
I do not remember how I installed ipython, but I didn't do it via brew, since when I type which ipython, I obtain /opt/local/bin/ipython. Is it the OS X version of ipython?
I installed all libraries on this version of ipython, for example I have matplotlib on ipython but not on python. I do not want to re-install everything again on the brew python, rather continue to install libraries on this version of ipython. How can I install new libraries there? For example, Python Image Library, or libjpeg?
If possible, I would like an exhaustive answer so to understand my problem, and not just a quick fix tip.
I installed python via brew, and made it my default python. If I run which python, I obtain /usr/local/bin/python.
Okay, good so far.
Also pip is installed via brew, which pip returns /usr/local/bin/pip.
Actually, not quite brew install python would have installed pip because even doing brew search pip comes up with this warning.
If you meant "pip" precisely:
Homebrew provides pip via: `brew install python`. However you will then
have two Pythons installed on your Mac, so alternatively you can install
pip via the instructions at:
https://pip.readthedocs.io/en/stable/installing/
So, Python came with pip, not brew install
when I type which ipython, I obtain /opt/local/bin/ipython. Is it the OSX version of ipython?
There is no "OSX version of ipython"...
I installed all libraries on this version of ipython, for example I have matplotlib on ipython but not on python.
You actually did install them to your brew installed Python. IPython is not a new installation of Python.
You can even start a python interpreter from the terminal and import matplotlib to check this
I do not want to re-install everything again on the brew python
What exactly needs re-installed? It's already installed into the brew python
To transfer all your packages you can use pip to freeze all of your packages installed in ipython and then install them all easily from the file that you put them in.
pip freeze > requirements.txt
then to install them from the file pip install -r requirements.txt
I'm not entirely sure if I understood what you're asking so if this isn't what you want to do please tell me.
OK, so I solved by uninstalling macport (and so the ipython I was using, which was under /opt/local/bin) and installing ipython via pip. Then I re-install what I needed (e.g. jupyter) via pip.

Categories

Resources