python is not installing dependencies listed in install_requires of setuptools

后端 未结 3 1017
梦毁少年i
梦毁少年i 2021-02-19 00:22

I have written a python module that depends on openpyxl. I want openpxyl to be installed as a dependency automatically using setuptools. I read that the proper way to do this is

3条回答
  •  南旧
    南旧 (楼主)
    2021-02-19 01:09

    Try providing your dependency both in install_requires and setup_requires.

    Following is from setuptool's documentation at https://pythonhosted.org/setuptools/setuptools.html

    setup_requires

    A string or list of strings specifying what other distributions need to be present in order for the setup script to run. setuptools will attempt to obtain these (even going so far as to download them using EasyInstall) before processing the rest of the setup script or commands. This argument is needed if you are using distutils extensions as part of your build process; for example, extensions that process setup() arguments and turn them into EGG-INFO metadata files.

    (Note: projects listed in setup_requires will NOT be automatically installed on the system where the setup script is being run. They are simply downloaded to the ./.eggs directory if they’re not locally available already. If you want them to be installed, as well as being available when the setup script is run, you should add them to install_requires and setup_requires.)

提交回复
热议问题