How can I install from a git subdirectory with pip?

前端 未结 2 1845
我寻月下人不归
我寻月下人不归 2020-12-12 15:03

I have a git repository with many folders, one of them being a python module installable with pip, like this:

repo.git/
repo.git/folder1/
repo.git/folder2/
r         


        
2条回答
  •  有刺的猬
    2020-12-12 15:18

    It's been already stated in one of the comments under the correct answer, but just to highlight this issue: when executing this from Linux command line, you must escape the &-character since ampersand is telling the command line to run a command in background:

    git+https://git.repo/some_repo.git#egg=version_subpkg\&subdirectory=repo
    

    Notice the backslash before the ampersand. The escaping behaviour might depend on the Linux distro; I'm not an expert.
    If you ignore this, you might run into a cryptic error like the following:

    bash: (...) command not found
    

提交回复
热议问题