-1

I participate in a legacy project development, which uses python version 3.6.15. I installed this version with pyenv and created the virtual environment like that:

python -m pip install virtualenv
python -m virtualenv venv
source venv/bin/activate

So the Python version is correct.

$ python --version
Python 3.6.15

$ which python
.../venv/bin/python

But when I try to install packages from the requirements.txt I face a problems like this one:

ERROR: Could not find a version that satisfies the requirement anyjson>=0.3.3 (from kombu) (from versions: 0.1, 0.2.0, 0.2.1, 0.2.2, 0.2.3, 0.2.4, 0.2.5, 0.3, 0.3.1, 0.3.2, 0.3.3)
ERROR: No matching distribution found for anyjson>=0.3.3

It can't find a package version, but package version is listed in the from version: section. And it happens in multiple cases. But in the Docker image which uses docker.io/library/python:3.6.15 as a base everything is installed successfully. What could be the problem of this behavior?

OS: Ubuntu 22.04

voilalex
  • 2,041
  • 2
  • 13
  • 18

1 Answers1

0

I trued to install anyjson>=0.3.3 on Debian with Python 3.6.15 and got this error

error in anyjson setup command: use_2to3 is invalid.

in addition to

ERROR: Could not find a version that satisfies the requirement anyjson>=0.3.3 (from versions: 0.1, 0.2.0, 0.2.1, 0.2.2, 0.2.3, 0.2.4, 0.2.5, 0.3, 0.3.1, 0.3.2, 0.3.3)
ERROR: No matching distribution found for anyjson>=0.3.3

So I fixed the 1st error with

pip install --upgrade "setuptools<58"

(found in https://stackoverflow.com/a/69100830/7976758 , https://stackoverflow.com/search?q=%5Bpip%5D+error+in+setup+command%3A+use_2to3+is+invalid)

and then retried:

$ pip install -U "anyjson>=0.3.3"
Collecting anyjson>=0.3.3
  Using cached anyjson-0.3.3.tar.gz (8.3 kB)
  Preparing metadata (setup.py) ... done
Building wheels for collected packages: anyjson
  Building wheel for anyjson (setup.py) ... done
  Created wheel for anyjson: filename=anyjson-0.3.3-py3-none-any.whl size=4972 sha256=fe5c1891804ad1273afdd3a3763140bcd97b933e585fa66044770da9443dc561
  Stored in directory: /home/phd/.cache/pip/wheels/b9/bd/95/00661ac6fe3bc60296ccb45e91518eb6b57c905fd077177aeb
Successfully built anyjson
Installing collected packages: anyjson
Successfully installed anyjson-0.3.3

PS. The bottom line: always show us the entire text of the error message.

phd
  • 82,685
  • 13
  • 120
  • 165