Python package version not found, but it's clearly there - python

I am trying to create specific python environment inside docker for reproducible builds, but package python-opencv that previously was manually installed refuses to get installed with error:
ERROR: Could not find a version that satisfies the requirement opencv_python==4.7.0 (from versions: 3.4.0.14, 3.4.10.37, 3.4.11.39, 3.4.11.41, 3.4.11.43, 3.4.11.45, 3.4.13.47, 3.4.15.55, 3.4.16.57, 3.4.16.59, 3.4.17.61, 3.4.17.63, 3.4.18.65, 4.3.0.38, 4.4.0.40, 4.4.0.42, 4.4.0.44, 4.4.0.46, 4.5.1.48, 4.5.3.56, 4.5.4.58, 4.5.4.60, 4.5.5.62, 4.5.5.64, 4.6.0.66, 4.7.0.68)
ERROR: No matching distribution found for opencv_python==4.7.0
Command was:
pip3 install face_recognition==1.3.0 opencv_python==4.7.0
Inside docker: ubuntu 22.04; Python 3.10.6; pip 22.0.2
Why pip3 cannot find opencv_python version 4.7.0 since it's clearly in the list of available packages? What's the best way to create reproducible python environment when building docker image?

You need to specify the exact version, so:
opencv_python==4.7.0.68
Otherwise, you can ask for approximate versions using one of the following:
opencv_python~=4.7.0
opencv_python==4.7.0.*

Related

Pip install troubleshooting - not finding valid distribution

I am trying to install mediapipe with pip in Python 3.10 from MacOS Monterey.
(mp_env_3.10_rosetta) ➜ ~ pip3.10 install mediapipe
ERROR: Could not find a version that satisfies the requirement mediapipe (from versions: none)
ERROR: No matching distribution found for mediapipe
I've even downloaded the wheel files, but they tell me that the platform doesn't match when I try to install them. I have tried this with and without Rosetta (since mediapipe is not supported on the APple M1 chip yet), and with all the wheel files.
(mp_env_3.10_rosetta) ➜ ~ pip3.10 install ~/Downloads/MediaPipe/mediapipe-0.8.10-cp310-cp310-macosx_10_15_x86_64.whl
ERROR: mediapipe-0.8.10-cp310-cp310-macosx_10_15_x86_64.whl is not a supported wheel on this platform.
All my teammates, who have the same laptops with the same OS, doing the same thing as I am doing, are not running into this problem. I am totally puzzled.
My main question here is, is there some way to get debugging info from pip to tell why it doesn't think it can find a match? Can I see if it doesn't know my platform, or OS, or Python version?

Mamba can't create env giving 'nothing provides' but pip sees such version of opencv-python

I need to create env with
mamba create --name tf1_12__HDR Tensorflow==1.12.0 Keras==2.2.4 opencv-python==3.4.4.19 anaconda
It provides
mamba (0.7.3) supported by #QuantStack
...
Looking for: ['tensorflow==1.12.0', 'keras==2.2.4', 'opencv-python==3.4.4.19', 'anaconda']
...
Problem: nothing provides requested opencv-python 3.4.4.19
I am calling
pip install opencv-python==
ERROR: Could not find a version that satisfies the requirement opencv-python== (from versions: 3.4.2.17, 3.4.3.18, 3.4.4.19, 3.4.5.20, 3.4.6.27, 3.4.7.28, 3.4.8.29, 3.4.9.31, 3.4.9.33, 3.4.10.35, 3.4.10.37, 3.4.11.39, 3.4.11.41, 3.4.11.43, 3.4.11.45, 3.4.13.47, 3.4.14.51, 3.4.14.53, 3.4.15.55, 3.4.16.57, 4.0.0.21, 4.0.1.23, 4.0.1.24, 4.1.0.25, 4.1.1.26, 4.1.2.30, 4.2.0.32, 4.2.0.34, 4.3.0.36, 4.3.0.38, 4.4.0.40, 4.4.0.42, 4.4.0.44, 4.4.0.46, 4.5.1.48, 4.5.2.52, 4.5.2.54, 4.5.3.56, 4.5.4.58)
ERROR: No matching distribution found for opencv-python==
So such version exists.
I know a cheat to overcome issue using steps:
1 Create env without opencv-python
2 Install opencv-python with pip
but it can lead to conflicts inside enviroment and potentially break it.
Can you please provide a "clean" solution and/or describe the reason of this
unexpected output?
PyPI and Anaconda Cloud packages don't necessarily go by the same names. The opencv package from Conda Forge will include the OpenCV libs (libopencv) and the Python interface (py-opencv). That is, install opencv with the version you want.
BTW, as mentioned in the comments == is Pip syntax, Conda/Mamba use single =.

ERROR: Could not find a version that satisfies the requirement protos ERROR: No matching distribution found for protos when trying to install protos

I am trying to install protos using pip install protos but I get following error messages ERROR: Could not find a version that satisfies the requirement protos ERROR: No matching distribution found for protos (these are 2 different lines btw). Does anybody have the same problem because maybe I do not meet the requirements but I the problem is that I don't know which requirements, I just don't find any information. I am using python 3.6.2, pip 20.3.3 and windows 10
The protos package can be found here: https://pypi.org/project/protos/
According to the PyPi page, it requires Python 3.7 or greater. Since you are running Python 3.6 you get the error message when running pip install protos.
If you are looking for Google's protocol buffer, then you should look at pip install protobuf (docs here).

How to install PyTorch on Python 3.7 / Windows 10 with pip

I am trying to install PyTorch 1.3 using pip :
pip3 install torch==1.3.1+cpu torchvision==0.4.2+cpu -f https://download.pytorch.org/whl/torch_stable.html
I got the command line from this page :
https://pytorch.org/get-started/locally/#start-locally
It fails, with the following error message :
ERROR: Could not find a version that satisfies the requirement
torch==1.3.1+cpu (from versions: 0.1.2, 0.1.2.post1, 0.1.2.post2)
ERROR: No matching distribution found for torch==1.3.1+cpu
Using verbose mode (-v) give a little more info :
Skipping link: unsupported archive format: .html:
https://download.pytorch.org/whl/torch_stable.html (from -f)
Analyzing links from page https://pypi.org/simple/torch/
It seems pip cannot use the url I provide and will get packages from another URL.
That one support at best Python 3.6. Since I have installed 3.7.5 (which is support by URL initially provided) none of the packages match and it fails.
I could downgrade to 3.6 but since 3.7 is officially supported I would like to try to fix that issue first.
EDIT : pip is up to date. I got exact same error on both Windows 10 and 7 64 bit machines.
Also: the PyTorch page says :
Please ensure that you have met the prerequisites below (e.g., numpy)
But AFAIK does not list any library in that section. During my tests, numpy was installed and up to date.
As requested, here is the full output of pip :
https://pastebin.com/8Wpqp6du
You error is being triggered because the version 1.3.1+cpu doesn't exist.
If you go to pytorch.org you will be able to select a version of pytorch and your OS, where it will give you a command to install pyTorch correctly, for Python 3.7 and PIP use the following:
pip3 install --find-links https://download.pytorch.org/whl/torch_stable.html torch==1.3.1 torchvision==0.4.2
Remember to check that the pip3 binary you are using is the one installed over Python 3.7.
Also, mind that the documentation you are pointing at is for MacOS.

Tensorflow on 32-bit Windows 10: is not a supported wheel on this platform; package missing in current win-32 channels, no matching distribution

I have been following the installation guide from http://machinelearningmastery.com/setup-python-environment-machine-learning-deep-learning-anaconda/
I got & am using:
conda 4.3.22
Python 3.5.3 :: Anaconda 4.4.0 (32-bit)
scipy: 0.19.0
numpy: 1.12.1
matplotlib: 2.0.2
pandas: 0.20.1
statsmodels: 0.8.0
sklearn: 0.18.2
I successfully installed theano & keras. HOWEVER, I FAIL at installing tensorflow. Please HELP.
I created a conda ‘tensorflow’ environment with python 3.5. With command
『pip install –ignore-installed –upgrade https://storage.googleapis.com/tensorflow/windows/cpu/tensorflow-1.2.1-cp35-cp35m-win_amd64.whl』
I got ERROR saying
『tensorflow-1.2.1-cp35-cp35m-win_amd64.whl is not a supported wheel on this platform』
So i changed to version 1.0.1 and same error.
Version 1.1.0 also same error.
So i deactivated the environment, and type command
『conda install -c conda-forge tensorflow』
I got ERROR
『PackageNotFoundError: Package missing in current win-32 channels』
Instead it says the close match found is “xtensor” which i know is a C++ library that I'm not looking for.
Is it because I’m using a 32-bit Windows 10?
So I also tried running the following :
『python -m pip install –upgrade tensorflow』
and got ERROR of
『Could not find a version that satisfies the requirement tensorflow (from versions: ) No matching distribution found for tensorflow』
What more requirements do i need for this?
I tried 『pip3 install tensorflow』 but somehow it could not recognized ‘pip3’. So i type 『where pip3』 and it could not find files for the given pattern. So i type『where python』. It ouput the directory of my python. Then checked if it’s already put under the path inside the environmental variable. And it has. But i still couldn't use pip3 command.
I have tried all the solutions provided from people having similar problem with me and none of them work.
This question has been answered here.
In short, yes, TensorFlow does not support 32-bit platforms. Although if you only plan on writing abstract high-level Keras code then Theano will do just fine.

Categories

Resources