0

my python project is packaged by setuptools,this is my setup.opt:

[metadata]
name = totems_pycommon
version = 1.0.0
#long_description = file: README.rst, CHANGELOG.rst, LICENSE.rst
include_package_data = True

# 依赖
install_requires=
    kafka==1.2.0
    elasticsearch7==7.14.1
    requests

[options]
python_requires = >=3.6
packages = find:
package_dir =
    =.

[options.packages.find]
where = .
#include = *
exclude = *.test

[options.package_data]
* = *.ini

i defind the depend package in install_requires,and i thought when i package my project by setuptools and then install the package by pip install,the depend package will be download automatically ,but it did not ,why and what the install_requires is used for?

when i install my project

cizario
  • 3,995
  • 3
  • 13
  • 27

2 Answers2

0

You should change kafka==1.2.0 for kafka-python==1.2.0

install_requires=
    kafka-python==1.2.0
    elasticsearch7==7.14.1
    requests
cizario
  • 3,995
  • 3
  • 13
  • 27
Nederxus
  • 65
  • 1
  • 5
0

refer to this topic https://setuptools.pypa.io/en/latest/userguide/declarative_config.html#options

you have to move install_requires and include_package_data to options section

your setup.cfg should be:

[metadata]
name = totems_pycommon
version = 1.0.0
#long_description = file: README.rst, CHANGELOG.rst, LICENSE.rst

[options]
python_requires = >=3.6
packages = find:
package_dir =
    =.

include_package_data = True
# 依赖
install_requires=
    kafka==1.2.0
    elasticsearch7==7.14.1
    requests

[options.packages.find]
where = .
#include = *
exclude = *.test

[options.package_data]
* = *.ini
cizario
  • 3,995
  • 3
  • 13
  • 27