Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

install from a git subdirectory with pip requirements

Tags:

git

python

pip

I have the following structure in git

scripts/
scripts/folder1/
scripts/folder1/module
scripts/folder1/module/setup.py
scripts/folder1/module/src/module
scripts/folder1/module/src/module/__init__.py
scripts/folder1/module/src/module/source.py

I want to install module , so I tried the following in my requirements.txt

git+https://[email protected]/repo-name/scripts.git#egg=module&subdirectory=module 

but this does not seem to work and I get the following error:

IOError: [Errno 2] No such file or directory: '/private/var/folders/p_/gz96g4610fn94hz6w_l2gjyw0000gn/T/pip-build-MLhekq/module/module/setup.py

I understand that this question may have been answered at How can I install from a git subdirectory with pip? but I am looking for the exact syntax in my case.

like image 568
kk1957 Avatar asked Mar 18 '16 00:03

kk1957


People also ask

Can you install Git with pip?

You can deploy Git locally, or use it via a hosted service, such as Github, Gitlab or Bitbucket. One of the advantages of using pip together with Git is to install the latest commits of unreleased Python packages as branches from Github.

Can pip install from local directory?

Install the downloaded package into a local directory : python get-pip.py --user This will install pip to your local directory (. local/bin) . Now you may navigate to this directory (cd . local/bin) and then use pip or better set your $PATH variable this directory to use pip anywhere : PATH=$PATH:~/.

Is it possible to use pip to install a package from a private github repository?

Read the Docs uses pip to install your Python packages. If you have private dependencies, you can install them from a private Git repository or a private repository manager.


1 Answers

ok, just figured out this. For anyone who may spend hours on this

git+https://[email protected]/repo-name/scripts.git#subdirectory=folder1/module
like image 95
kk1957 Avatar answered Sep 19 '22 01:09

kk1957