I have created a custom python package on a GitLab repository, which I can successfully install with the following pip command in a local terminal (terms with <>
represent variables that need to be replaced before running the command):
pip install <packagename> --extra-index-url https://<access_token_name>:<access_token>@gitlab.com/api/v4/projects/24/packages/pypi/simple
However, my constraint is that I need to install this package from an anaconda environment created with a conda.yaml
file. An example of this file is shown below.
name: test
channels:
- defaults
dependencies:
- python=3.8
- pip
- pip:
- pandas==1.2.4
- numpy==1.20.2
My question: How do I add the custom package to the conda.yaml
? It seems that the conda.yaml
allows to specify dependencies in the format <packagename>==<package_version>
but it does not allow for custom pip install
commands like the one above.
What I have tried I tried adding - "--extra-index-url https://<access_token_name>:<access_token>@gitlab.com/api/v4/projects/24/packages/pypi/simple"
to the dependencies (as an item under - pip:
) and could then successfully create a conda environment with conda env create -f conda.yaml
, i.e. this command was executed without error message. However, my package <packagename>
did not actually get installed, i.e. it was not listed in conda list
and it was not possible to import the package (after activating the new environment).