如何从包含多个软件包的存储库安装 python 软件包?

How to install a python package from repository with several packages?

你好,我有一个存储库,其中有一个名为 Packages 的文件夹,里面有几个 python 包及其设置和安装所需的所有配置。

我可以在本地安装它,指示包的完整路径,但是当我尝试从存储库执行相同操作时,我不能。

如何使用 pipenv 安装其中一个软件包?

我尝试了以下方法:

pipenv install -e git+https://TOKEN@github.com/user/repo#egg=package

pipenv install -e git+https://TOKEN@github.com/user/repo/branch/path#egg=package

但是没有用我收到这个错误:

Error text: Obtaining socks-utils from git+https://****@github.com/............#egg=socks-utils
... has inconsistent name: filename has 'package', but metadata has 'UNKNOWN'

令牌正确我可以用那个 url 在另一个文件夹中克隆它。

谢谢

引用自the pip documentation

If your repository layout is:

pkg_dir
├── setup.py  # setup.py for package "pkg"
└── some_module.py
other_dir
└── some_file
some_other_file

Then, to install from this repository, the syntax would be:

python -m pip install -e "vcs+protocol://repo_url/#egg=pkg&subdirectory=pkg_dir"

因此,您需要:

pipenv install -e "git+https://TOKEN@github.com/user/repo#egg=package&subdirectory=path"