Installation issues using pip for OpenCv - python

I am currently on Linux x86-64 machine. I am trying to install opencv in my virtual environment using pip however the error I keep receiving is
ERROR: Could not find a version that satisfies the requirement numpy==1.19.3 (from versions: 1.19.2+computecanada, 1.21.0+computecanada, 1.21.2+computecanada)
ERROR: No matching distribution found for numpy==1.19.3
I am running python 3.9.6 (64bit) and my current numpy version is 1.21.3. the command I've been using is pip install opencv-python. i've also tried uninstalling other instances of openCV and have tried the other options all with the same error. Does openCV not support numpy 1.21.3? Would anyone be able to point me in the right direction?

On computecanada you don't need to install OpenCV.
You can use it by following these commands:
module spider opencv
module load opencv/version

Actually, this error happens if numpy version does not match OpenCV required version.
for my case:
I used python 3.6. so I solved this error by following:
pip install numpy==1.19.0
pip install opencv-python==3.4.11.45
after installing numpy I search which OpenCV version support this numpy version, I found 3.4.11.45 so I install it by 2 number command and it is working.

Related

How to install pyramid-arima in python 3.7

I'm trying to implement auto arima in my python 3.7 on Windows10 So I tried to install pyramid-armia using following command
pip install pyramid-arima
But I'm getting error message
Could not find a version that satisfies the requirement pyramid-arima (from versions: )]
No matching distribution found for pyramid-arima
I also tried steps mentioned here
But got the same error message
Can you please guide me to install it?
This error might be because there is no version of package that fits combination of versions of your Python, Operating System, Cpu Type and Instruction Set.
That package is out-dated and abandoned, hence not installable, use new replacement, which is pmdarima package:
pip install pmdarima
and import like:
import pmdarima
Official documentation for pmdarima is here.
If still you're getting same error for new pmdarima then download .whl package directly from here.
You need to download package corresponding to your python version and windows bits. E.g. if you have Python 3.7 and Windows 64-bit then download pmdarima-1.7.1-cp37-cp37m-win_amd64.whl (or with win32 suffix for 32-bit windows), here cp37 means CPython version 3.7.
Then just install it like this:
pip install pmdarima-1.7.1-cp37-cp37m-win_amd64.whl
Also many trouble-some Windows prebuild .whl packages that have problems with installation/compilation are located here. I've often downloaded this prebuilt packages from there, when haven't succeeded with pip install. But for the case of pmdarima it is located at the first link but not second.

Unable to install tensorflow-compression

I get this error every time I try to install tensorflow-compression
ERROR: Could not find a version that satisfies the requirement tensorflow-compression (from versions: none)
ERROR: No matching distribution found for tensorflow-compression
I'm using python 3.6.8 and tensorflow-gpu 1.14.0.
This package does exist and was recently updated:
https://pypi.org/project/tensorflow-compression/
I've tried to install it in a python 2.7 environment, but it didn't work.
Also tried to specify the latest version pip install tensorflow-compression==1.2, but it also didn't work.
At the time of writing this, prebuilt wheels of tensorflow-compression exist only for Linux/MacOS. Quoting the readme:
Installation
Note: Precompiled packages are currently only provided for Linux (Python 2.7, 3.3-3.7) and Darwin/Mac OS (Python 2.7, 3.7).
To use these packages on Windows, consider using a TensorFlow Docker image and installing tensorflow-compression using pip inside the Docker container.
Windows is currently not supported. Please use one of TensorFlow's Docker images (https://www.tensorflow.org/install/docker) and pip install tensorflow_compression there.

pypy not installing opencv

I want to use pypy to gain speed for a project I am doing and I need to use opencv and numpy but when trying to install opencv from pycharm interpreter settings I get the following error:
Collecting opencv-python
DEPRECATION: A future version of pip will drop support for Python 2.7.
ERROR: Could not find a version that satisfies the requirement
opencv-python (from versions: none) ERROR: No matching distribution
found for opencv-python
how to install opencv to use with pypy?
Since it is difficult to build OpenCV, they only upload binary wheels to PyPI (where pip goes to get packages). If you really want to use OpenCV on PyPy, you will have to compile from a github checkout of https://github.com/skvark/opencv-python. If you make any progress on this, please let the maintainer of that repo know, the best would be via a PR that explains how to successfully build. Then they could upload the binary packages to PyPI for PyPY.
to install opencv you need to execute this command:
pip install opencv-python
ps : Use this commnad even if you want to use cv2
Hope I've helped you.

Attempting to install Python PIL module fails with "Non-zero exit code"

I really don't get why Python is so difficult to get up and running properly.
Anyway, I've just fresh installed Python 3.7 and PyCharm. I want to get the Python Imaging Library working within my project, but when I try to install it using PyCharm I get the following error:
pip install PIL
Non-zero exit code (1)
Try to run this command from the system terminal. Make sure that you use the correct version of 'pip' installed for your Python interpreter located at 'C:\Users\Jake\AppData\Local\Programs\Python\Python37-32\python.exe'.
Command output:
Collecting PIL
Could not find a version that satisfies the requirement PIL (from versions: )
No matching distribution found for PIL
You are using pip version 10.0.1, however version 18.0 is available.
You should consider upgrading via the 'python -m pip install --upgrade pip' command.
I've attempted to run python -m pip install --upgrade pip from a CMD prompt, but I then get this error:
Fatal Python error: Py_Initialize: unable to load the file system codec
ModuleNotFoundError: No module named 'encodings'
I just tried to install NumPy using the exact same method for PIL and Numpy installed without any issues whatsoever. This leads me to think that maybe PIL isn't supported for Python 3.7?
Can someone explain to me what the issue is here and help me with importing modules into my PyCharm project?
PIL is not maintained anymore. You can use Pillow instead, a more active fork of PIL.
pip install Pillow

Unable to install cv2 on windows

I am trying to install opencv in python on my windows machine but I am unable to do so. I have python 2.7.11::Anaconda 2.4.1 <32-bit>
Here is what I have tried till now -
pip install cv2 on command line gives the error :
could not find a
version that satisfies the requirement cv2
I downloaded the package from sourceforge site, followed the steps
and pasted cv2.pyd in C:\Python27\Lib\site-packages but still it is
not working. I get the following error message
ImportError: No
module named cv2
(I already have numpy installed and it works just fine).
pip install opencv-python
you can type this instead of
pip install cv2
it also works with anaconda pro
I was able to solve the error.
If you are using python version 3 , sometimes you have to use pip3.
pip3 install opencv-python
Make sure you are using python 3 , it won't work for python 2.
Try
pip install opencv-python==4.3.0.36
So I was using PyCharm, and what worked for me was to install it directly from file->settings, Project:your-project-name->Python Interpreter list

Categories

Resources