6

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://user@bitbucket.org/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.

Community
  • 1
  • 1
kk1957
  • 8,246
  • 10
  • 41
  • 63

1 Answers1

12

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

git+https://user@bitbucket.org/repo-name/scripts.git#subdirectory=folder1/module
kk1957
  • 8,246
  • 10
  • 41
  • 63
  • 3
    what about the egg name? `#egg=mypackage` – tarabyte Aug 06 '16 at 00:21
  • If you are on Windows in a `cmd.exe`, you will want to escape the `&` with a `^` sign. Like so: `pip install git+https://user@bitbucket.org/repo-name/scripts.git#egg=my_package^&subdirectory=folder1/module` – ereOn Oct 25 '16 at 14:21
  • tip for others: you HAVE to use git+https, git+git will not work, you'll get fatal: remote error: Repository not found. presumably because it doesn't parse the "query" string correctly. I've just logged: https://github.com/pypa/pip/issues/4898 – amohr Nov 30 '17 at 22:44