How do I make Pip respect requirements?

前端 未结 1 1171
萌比男神i
萌比男神i 2021-01-11 17:21

If I create a setup.py using requires, Pip doesn\'t install my dependencies.

Here\'s my setup.py:

from distutils.core import setup

setu         


        
1条回答
  •  粉色の甜心
    2021-01-11 17:37

    The correct spelling is install_requires, not requires; this does require that you use setuptools, not distutils:

    from setuptools import setup
    
    setup(name='my_project',
          description="Just a test project",
          version="1.0",
          py_modules=['sample'],
          install_requires=['requests'])
    

    I can recommend the Python Packaging User Guide for the nitty gritty details.

    0 讨论(0)
提交回复
热议问题