简体   繁体   中英

pip show not showing requirements

When I run the pip show command on my package Classeviva.py I get the following.

D:\Python\Python\Classeviva>pip show classeviva.py
Name: Classeviva.py
Version: 0.1.1.post1
Summary: Classeviva Python API wrapper
Home-page: https://github.com/Lioydiano/Classeviva
Author: FLAK-ZOSO
Author-email: @gmail.com
License: 
Location: c:\users\...\appdata\local\packages\pythonsoftwarefoundation.python.3.10_qbz5n2kfra8p0\localcache\local-packages\python310\site-packages
Requires: 
Required-by: 

In particular the field Requires: is empty, despite being included in setup.py (current version at url).

requires=["requests"]

And in pyproject.toml too. In it I specified license too, so I don't get why pip isn't showing it in the field license .

[build-system]
license = "MIT"
requires = ["setuptools>=42", "requests>=2.27.1"]
build-backend = "setuptools.build_meta"

Edit


This is the folder structure under D:\\Python\Python\Classeviva , it can be found on GitHub at the repository, except for .gitignore d files and folders.

...

Edit (1)


Adding install_requires='requests>=2.27' as argument to the setuptools.setup call, as suggested below by Iguananaut , made the requirement visible via pip .

Requires: requests

Use of setup.py files are all but deprecated (in favor of static setup.cfg files). What's more, the requires= keyword is an even older artifact of distutils and is not really used at all in setuptools.

What you want here is the deceptively similar install_requires='requests>=2.27'

Putting requires=['requests'] in pyproject.toml is, unless you know exactly what you're doing, pretty useless. This requires is just what the build system for your project requires, and has no connection to the runtime requirements of your project.

Welcome to the not at all confusing world of Python packaging.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM