conda-lock
conda-lock copied to clipboard
Trying to install private GitHub repo as pip package.
Hi there,
I am trying to perform conda lock -p osx-64 -p osx-arm64 -p linux-64 -p linux-aarch64 -f environment.yml --filename-template 'x-{platform}.lock'
with an evironment.yml file like so that contains a private pip package hosted in a private GitHub repo:
name: xxxx
channels:
- conda-forge
- defaults
dependencies:
- python=3.9
- scikit-learn=1.0.0
- pip
- boto3
- slackclient
- conda-lock
- pip:
- git+ssh://[email protected]/xxxxxxxxxx
- pytz
But I get the error pkg_resources.extern.packaging.requirements.InvalidRequirement: Parse error at "'+ssh://g'": Expected string_end
.
I can easily install the private repo by running the normal conda env create --prefix ./env -f environment.yml
. So just wondering what I'm doing wrong here :)
possibly relating to this issue here: 187
FWIW, I've found something of a workaround for now. An example from my own code:
dependencies:
- python
- pip:
- pymatbridge @ https://github.com/arokem/python-matlab-bridge/archive/51c0e79aa6ecb9ae11d02ad367c1bfa0b27c2caa.zip#sha256=
The package @ url
form (https://pip.pypa.io/en/stable/reference/requirement-specifiers/) seems to be key. Note that it only seems to work with zips or tarballs, not git specifiers (does that even work with private repos?). The md5
or sha256
key must also be present but seems not to be checked. Not sure if the package's dependencies will be locked with this approach.
A lot of disclaimers, as you see. :)
Requesting this as well. We're using conda-lock and would love to be able to easily manage our private pip dependencies with it 👍
As @ovidner alluded to, this is not only an issue with private repos; it seems to affect all pip packages installed through git.
I ran into exactly the same problem
Support for git+x://
pip specifications was mentioned in #4 which is marked as complete, but that was either not implemented or has broken since. Would be great to be able to use git+https://
, etc!