Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Trying to install private GitHub repo as pip package. #197

Open
seanyboi opened this issue Jun 1, 2022 · 6 comments
Open

Trying to install private GitHub repo as pip package. #197

seanyboi opened this issue Jun 1, 2022 · 6 comments

Comments

@seanyboi
Copy link

seanyboi commented Jun 1, 2022

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://git@github.com/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 :)

@seanyboi
Copy link
Author

seanyboi commented Jun 1, 2022

possibly relating to this issue here: 187

@ovidner
Copy link

ovidner commented Jun 9, 2022

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. :)

@nealstewart
Copy link

Requesting this as well. We're using conda-lock and would love to be able to easily manage our private pip dependencies with it 👍

@zmbc
Copy link

zmbc commented Jul 22, 2022

As @ovidner alluded to, this is not only an issue with private repos; it seems to affect all pip packages installed through git.

@emsrc
Copy link

emsrc commented Aug 5, 2022

I ran into exactly the same problem

@srstsavage
Copy link

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!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants