Title: How to install pypi package from gitlab package?
Tags: python;gitlab
Question: There is a file requirements.txt with many packages build on gitlab so when I try pip install -r file requirements.txt it fails
The packages look like this
https://token:PERSONAL_TOKEN&gt;@gitlab.com/api/v4/projects/<PROJECT_ID&gt;/packages/pypi/simple
It returns 404 Error


Here is another answer: Make sure you have access to the project containing the packages. If you are logged in (that is, your token is correct) but you don't have access to that repository, GitLab will return a 404 error,

Here is another answer: Are you trying to automate it? (i.e. without GUI?)
If yes, it is possible. Focus on downloading/cloning the entire folder with the wheels to your working directory. It is possible in 2 ways:
using raw https (hotlinking) if your repo is public
using API like how you are doing if your repo is private
Although you are using option 2, it seems your API command is not actually downloading anything. try being more specific. For example, to download a numpy.whl file from the root directory a private repository with a Project # of 11:
mkdir parentfolder\
curl --header &quot;PRIVATE-TOKEN: [PRIVATE_TOKEN]&quot; https://gitlab.com/api/v4/projects/11/repository/files/numpy.whl/raw?ref=master -o parentfolder\numpy.whl
pip install -r requirements.txt --no-index --find-links=&quot;parentfolder\&quot;
Comment for this answer: Adding build artifacts to the repository is generally a bad idea. The question was about the integrated package repository of GitLab which is a much better solution because it provides an endpoint for `pip` to properly fetch the package.

{'source': 'StackExchangeDataset', 'subset': 'stackoverflow.com', 'metadata': {'AnswerCount': 2, 'CommentCount': 0, 'ContentLicense': 'CC BY-SA 4.0', 'CreationDate': '2021:00:06/17/21', 'FavoriteCount': None, 'PostTypeId': 1, 'Tags': '<python><gitlab>', 'Title': 'How to install pypi package from gitlab package?', 'ViewCount': 719, 'id': 68011476, 'user_AboutMe': None, 'user_AccountId': 15779308.0, 'user_DisplayName': 'Nicolas Rondon', 'user_Reputation': 115.0, 'user_Views': 32.0, 'user_id': 11386201.0}}