推荐学习书目
Learn Python the Hard Way
Python Sites
PyPI - Python Package Index
http://diveintopython.org/toc/index.html
Pocoo
值得关注的项目
PyPy
Celery
Jinja2
Read the Docs
gevent
pyenv
virtualenv
Stackless Python
Beautiful Soup
结巴中文分词
Green Unicorn
Sentry
Shovel
Pyflakes
pytest
Python 编程
pep8 Checker
Styles
PEP 8
Google Python Style Guide
Code Style from The Hitchhiker's Guide
James369
V2EX  ›  Python

如何查看一个软件包(未安装)的依赖包?

  •  
  •   James369 · May 28, 2021 · 2745 views
    This topic created in 1834 days ago, the information mentioned may be changed or developed.
    主要是针对未安装的软件包,因为不知道会依赖哪些子包。
    我看了 pip 没有这方面的选项,即使登录 pypi.org 查看软件包,也看不到其依赖的子包。
    如何查看依赖?
    3 replies    2021-05-28 14:58:10 +08:00
    xiaolinjia
        1
    xiaolinjia  
       May 28, 2021
    去他的仓库,然后点开 setup.py 或者 requirements.txt 之类的文件,一般里面都有写。
    以 requests 为例,https://github.com/psf/requests/blob/master/setup.py#L43
    requires = [
    'chardet>=3.0.2,<5',
    'idna>=2.5,<3',
    'urllib3>=1.21.1,<1.27',
    'certifi>=2017.4.17'

    ]
    James369
        2
    James369  
    OP
       May 28, 2021
    @xiaolinjia 不错,虽然有点曲线救国
    Wincer
        3
    Wincer  
       May 28, 2021
    pip download -r requirements.txt 我一般都这么做,会递归下载所有的依赖
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Solana   ·   5337 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 35ms · UTC 06:02 · PVG 14:02 · LAX 23:02 · JFK 02:02
    ♥ Do have faith in what you're doing.