簡體   English   中英

如何讓 pipenv 安裝 package 子依賴項

[英]how can I get pipenv to install package sub dependencies

我有一個 package,它有一個依賴 B(sg_wrapper),它本身有一個依賴 C(shotgun_api3)。 使用 pipenv 安裝時,我可以訪問 B (sg_wrapper),但 B 本身無法導入 C。

這是我的 pipfile

[[source]]
name = "pypi"
url = "https://pypi.org/simple"
verify_ssl = true

[dev-packages]

[packages]
edl = "*"
timecode="*"
sg_wrapper = {git = "git+https://gitlab.com/kickstartent/sg_wrapper.git", editable=true}

[requires]
python_version = "3.7"

這是 package B setup.py

import setuptools

with open("README.md", "r") as fh:
    long_description = fh.read()

setuptools.setup(
    name="Shotgun wrapper",
    version="0.0.1",
    author="",
    author_email="",
    description="shotgun wrapper",
    long_description=long_description,
    long_description_content_type="text/markdown",
    url="hidden",
    packages=setuptools.find_packages(),
    classifiers=[
        "Programming Language :: Python :: 3",
        "License :: OSI Approved :: MIT License",
        "Operating System :: OS Independent",
    ],
    python_requires='>=3.6',
    install_requires=[
        'package_name @ git+https://github.com/shotgunsoftware/python-api.git'
    ]
)

您需要輸入真正的 package 名稱。

install_requires=[
        'package_name @ git+https://github.com/shotgunsoftware/python-api.git'
    ]

但是您輸入的是 package_name !!!

例如:

install_requires=[
    pycocotools @ git+https://github.com/cocodataset/cocoapi.git#subdirectory=PythonAPI
]

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM