Installing a private pypi package from Gitlab on a cluster

djhs
New Contributor III

I have published a pypi package in a private Gitlab repository and I want to install it in my notebook but I don't know how and the documentation doesn't help me much either. I have created a Gitlab token that I use in the index url and I try to install the package with the following line:

!pip install {package_name} --index-url https://__token__:{token}@gitlab.com/api/v4/projects/{project_id}/packages/pypi/simple

Where {token} is my Gitlab token and {project_id} is the Gitlab project ID.

This gives me:

Looking in indexes: https://__token__:****@gitlab.com/api/v4/projects/{project_id}/packages/pypi/simple ERROR: Ignored the following versions that require a different python version: 0.1.0 Requires-Python >=3.11,<4.0 ERROR: Could not find a version that satisfies the requirement {package-name} (from versions: none) ERROR: No matching distribution found for {package-name}

The command runs successfully locally.