python - 从具有 pip 要求的 git 子目录安装

标签 python git pip

<分区>

我在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

我想安装模块,所以我在我的 requirements.txt 中尝试了以下内容

git+https://user@bitbucket.org/repo-name/scripts.git#egg=module&subdirectory=module 

但这似乎不起作用,我收到以下错误:

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

我知道这个问题可能已经在 How can I install from a git subdirectory with pip? 得到了回答。但我正在寻找适合我的情况的确切语法。

最佳答案

好的,刚想通了这个。对于可能会在此花费数小时的任何人

git+https://user@bitbucket.org/repo-name/scripts.git#subdirectory=folder1/module

关于python - 从具有 pip 要求的 git 子目录安装,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/36073931/

相关文章:

python - Heroku 中的依赖库存放在哪里?

Git - 如何找到特定分支的第一次提交

heroku - 使用 pip 安装 NPM(节 pip 包管理器)?

python - 无法安装python ast

python - 安装 pydns 时出错

python - REST API - 批处理与多次调用

python - 字符串的所有可能排列

python - 需要帮助理解 python 中的 "TypeError: default __new__ takes no parameters"错误

具有单独工作树的 Git 子模块

吉蒂诺 : add a file that is in an excluded folder