python is not installing dependencies listed in install_requires of setuptools

后端 未结 3 1013
梦毁少年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:05

    I notice when you use override 'install' with a 'cmdclass' key. The pattern below also left me with uninstalled dependencies.

    Custom_Install(install):
        def run(self):
            # some custom commands
            install.run(self) 
    

    Adding the dependencies into setup_requires didn't work for me so in the end I just did my own pip install in the custom install command..

    def pip_install(package_name):
        subprocess.call(
            [sys.executable, '-m', 'pip', 'install', package_name]
        )
    

提交回复
热议问题