pythondockernexuspypinexus3

Unable to install PYPI Package from Sonatype-Nexus in Docker container: "No matching distribution found"


I have a hosted PyPI Sonatype Nexus Repository named pypi, where I store several packages, including pillow.

On my local machine, I can install pillow without any issues from the self-hosted pypi using the following command:

pip install pillow --trusted-host {HOST_NAME} --index-url https://{HOST_NAME}/repository/pypi/simple

Additionally, I can search for the package with:

pip search pillow --trusted-host {HOST_NAME} --index-url https://{HOST_NAME}/repository/pypi/pypi

Both commands work flawlessly on my local setup.

However, I'm facing an issue when trying to replicate this setup in a Docker environment using the python:3.9.19 image. While the pip search command works as expected, the pip install command fails with the following error:

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

It's worth noting that the pillow package is present in the PyPI repository, and I'm able to install it on my local machine without any problems. This issue also occurs with other packages, though some, like python-slugify, install without any issues.

Any help or suggestion on how to fix this?


Solution

  • Which version of pillow did you add to your repo? And what is your host machine python version (where it all works)?

    Pillow has some issues with different python versions and it doesn't fully support python3.9 : Documentation

    Probably you should try another pillow version or another python image in docker