简体   繁体   中英

Installing another source distribution in setup.py?

I have a dependency that's not on PyPi , but I have it in a source distribution tar file. Is there anyway to get setup.py to use the tar to install the dependency?

This doesn't work because dependency.tar.gz is not available after the project gets into an sdist:

from setuptools.command.install import install

class MyInstall(install):
    def run(self):
        os.system('pip install -U dependency.tar.gz')


setup(
      ...
      cmdclass={'install': MyInstall}
 )

Setuptools documentation actually covers installation of dependencies that aren't registered in PyPI.

http://pythonhosted.org/setuptools/setuptools.html#dependencies-that-aren-t-in-pypi

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