Pip in dockerfile cannot find distribution for text-diff

I have a requirements.txt file that gets looped through to install all of my python packages. All of my packages are fine except for text-diff for some reason. For that package i get a no matching distribution found error. I tried the same command on my local command prompt with no error.

Command in DockerFile: RUN pip3 install -r /usr/bin/requirements.txt

If you have a newer or older python version inside the container, it is possible that text-diff does not support that version so pip cannot find matching distribution for that specific Python version. Try to run a container from the image you used as a base image in the Dockerfile and install the latest text-diff without requirements.txt to see if it works.

pip3 install text-diff

When i run pip3 install text-diff i get the following error message

ERROR: Could not find a version that satisfies the requirement text-diff (from versions: none)
ERROR: No matching distribution found for text-diff

I did notice that my python version in the container is 2.7.5 while my computer uses 3.7.3 so that might have something to do with it.

Just to confirm this theory I downgraded my python on my local computer and attempted the same command with no issue

If you used pip3 as you wrote in your first post, it should not matter if the default python version in the container is Python 2 and not 3.

As long as you use the pip3 command, it should use Python3. Try with different containers instead of downgrading on the host. And use this syntax instead of using pip3 directly:

python3 -m pip install -r requirements.txt
# or
python3.8 -m pip install -r requirements.txt

so make sure you use the python version you want to and refer its “pip” module.

If you tell me what is your base image, I can try that pip command.