Install numpy + pandas as dependency in setup.py

穿精又带淫゛_ 提交于 2019-12-05 04:40:32

Please refer to the open issue https://github.com/numpy/numpy/issues/2434.

This is a known bug in numpy as it relates to setuptools.

As discussed there, use $ pip install -e . rather than $ python setup.py develop -- same result, but avoids this problem.

These should be declared with the install_requires kwarg of setup. Here's an example project, geopandas, which requires pandas:

setup(name='geopandas',
      version=FULLVERSION,
      description='Geographic pandas extensions',
      license='BSD',
      author='Kelsey Jordahl',
      author_email='kjordahl@enthought.com',
      url='http://geopandas.org',
      long_description=LONG_DESCRIPTION,
      packages=['geopandas', 'geopandas.io', 'geopandas.tools'],
      install_requires=[
        'pandas', 'shapely', 'fiona', 'descartes', 'pyproj', 'rtree'],  # here
)

You can also specify versions required, see setuptools docs, as often you'll want to ensure the version is recent (has the features/bug-fixes you rely on) - here's how I do that in pep8radius.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!