【发布时间】:2020-05-21 08:45:20
【问题描述】:
我正在尝试使用 setuptools 从 VCS 和子目录中安装依赖项。
我的setup.py 看起来像这样:
#!/usr/bin/env python3
from setuptools import setup
required = [
"package"
]
dependency_links = [
"git+ssh://git@host/repo.git@tag#subdirectory=subdir#egg=package-version"
]
setup(install_requires=required, dependency_links=dependency_links)
在 virtualenv 中运行 python3 setup.py install,我收到以下错误:
Download error on git+ssh://git@host/repo.git@tag#subdirectory=subdir#egg=package-version: unknown url type: git+ssh -- Some packages may not be found!
为了调试,我使用了以下公共 Github 存储库:
required = [
"pycocotools"
]
dependency_links = [
"git+https://github.com/cocodataset/cocoapi.git#subdirectory=PythonAPI#egg=pycocotools-2.0"
]
建议使用此示例here 作为类似问题的解决方案。
我得到了同样的unknown url type 错误(包最终是通过 PyPI 检索的,而不是通过 VCS URL !)。
我尝试过的
git+https://github.com/cocodataset/cocoapi.git#subdirectory=PythonAPI#egg=pycocotools-2.0
-
python3 setup.py install:unknown url type: git+https -- Some packages may not be found! -
pip3 install:ERROR: Could not install packages due to an EnvironmentError: [Errno 2] No such file or directory: '/tmp/pip-install-lwpbj7yv/pycocotools-2.0/PythonAPI#egg=pycocotools-2.0': '/tmp/pip-install-lwpbj7yv/pycocotools-2.0/PythonAPI#egg=pycocotools-2.0'
git+https://github.com/cocodataset/cocoapi.git#subdirectory=PythonAPI&egg=pycocotools-2.0
-
python3 setup.py install:unknown url type: git+https -- Some packages may not be found! -
pip3 install:好的,但是WARNING: Generating metadata for package pycocotools-2.0 produced metadata for project name pycocotools. Fix your #egg=pycocotools-2.0 fragments.
git+https://github.com/cocodataset/cocoapi.git#subdirectory=PythonAPI&egg=pycocotools
-
python3 setup.py install:unknown url type: git+https -- Some packages may not be found! -
pip3 install:好的
我也尝试删除所有这些 URL 的 git+,但它是 cannot detect archive format。
我正在使用的版本
- 设置工具 46.4.0
- python 3.6.9
- 点 20.1.1
【问题讨论】:
标签: python-3.x setuptools