Skip to content

package stored in pypi package registry fails to install with 404

Summary

pip install <my_package> fails with a 404 although the package is published in the pypi repository of the project

Steps to reproduce

  • Setup a project with a pypi repository, say senn_parrot_example
  • Add a package to it
  • Create a ~/.config/pip/pip.conf with appropriate contents (here for project ID 27519368):
[global]
extra-index-url = https://gitlab.com/api/v4/projects/27519368/packages/pypi/simple
trusted-host = gitlab.com
	       pypi.org
  • Optionally create a ~/.netrc with proper credentials to access the package registry (our other projects are private, this one is public in order to help with the bug report)
  • Run pip install senn_parrot_example:
Looking in indexes: https://pypi.org/simple, https://gitlab.com/api/v4/projects/27519368/packages/pypi/simple
Collecting senn_parrot_example==0.0.3
  ERROR: HTTP error 404 while getting https://gitlab.com/api/v4/projects/27519368/packages/pypi/files/senn_parrot_example-0.0.3-py3-none-any.whl#sha256= (from https://gitlab.com/api/v4/projects/27519368/packages/pypi/simple/senn-parrot-example/) (requires-python:>=3.6)
ERROR: Could not install requirement senn_parrot_example==0.0.3 from https://gitlab.com/api/v4/projects/27519368/packages/pypi/files/senn_parrot_example-0.0.3-py3-none-any.whl#sha256= because of HTTP error 404 Client Error: Not Found for url: https://gitlab.com/api/v4/projects/27519368/packages/pypi/files/senn_parrot_example-0.0.3-py3-none-any.whl for URL https://gitlab.com/api/v4/projects/27519368/packages/pypi/files/senn_parrot_example-0.0.3-py3-none-any.whl#sha256= (from https://gitlab.com/api/v4/projects/27519368/packages/pypi/simple/senn-parrot-example/) (requires-python:>=3.6)
  • It fails. The package should be installed instead.

Example Project

https://gitlab.com/ChloeTigre/bug-report-pypi

What is the current bug behavior?

The python package fails to install, after a 404 error. In addition, the index page https://gitlab.com/api/v4/projects/27519368/packages/pypi/simple/senn-parrot-example/ gives links that are supposed to be for packages but go 404.

What is the expected correct behavior?

The python package should be downloaded successfully. The index page should generate proper links that point to the right files.

Relevant logs and/or screenshots

(p3) MacBook-Pro-de-Matcha at ~ ❯ cat .config/pip/pip.conf
[global]
extra-index-url = https://gitlab.com/api/v4/projects/27519368/packages/pypi/simple
trusted-host = gitlab.com
	       pypi.org
(p3) MacBook-Pro-de-Matcha at ~ ❯ pip install senn_parrot_example
Looking in indexes: https://pypi.org/simple, https://gitlab.com/api/v4/projects/27519368/packages/pypi/simple
Collecting senn_parrot_example
  ERROR: HTTP error 404 while getting https://gitlab.com/api/v4/projects/27519368/packages/pypi/files/senn_parrot_example-0.0.3-py3-none-any.whl#sha256= (from https://gitlab.com/api/v4/projects/27519368/packages/pypi/simple/senn-parrot-example/) (requires-python:>=3.6)
ERROR: Could not install requirement senn_parrot_example from https://gitlab.com/api/v4/projects/27519368/packages/pypi/files/senn_parrot_example-0.0.3-py3-none-any.whl#sha256= because of HTTP error 404 Client Error: Not Found for url: https://gitlab.com/api/v4/projects/27519368/packages/pypi/files/senn_parrot_example-0.0.3-py3-none-any.whl for URL https://gitlab.com/api/v4/projects/27519368/packages/pypi/files/senn_parrot_example-0.0.3-py3-none-any.whl#sha256= (from https://gitlab.com/api/v4/projects/27519368/packages/pypi/simple/senn-parrot-example/) (requires-python:>=3.6)
WARNING: You are using pip version 21.1.1; however, version 21.1.2 is available.
You should consider upgrading via the '/Users/matcha/p3/bin/python3 -m pip install --upgrade pip' command.
(p3) MacBook-Pro-de-Matcha at ~ ❯

Output of checks

This bug happens on GitLab.com

Edited by Matcha