How to Bootstrap numpy installation in setup.py

前端 未结 7 1065
陌清茗
陌清茗 2020-12-02 12:12

I have a project which has a C extension which requires numpy. Ideally, I\'d like whoever downloads my project to just be able to run python setup.py install or

7条回答
  •  谎友^
    谎友^ (楼主)
    2020-12-02 12:52

    I found a very easy solution in [this post][1]:

    Or you can stick to https://github.com/pypa/pip/issues/5761. Here you install cython and numpy using setuptools.dist before actual setup:

    from setuptools import dist
    dist.Distribution().fetch_build_eggs(['Cython>=0.15.1', 'numpy>=1.10'])
    

    Works well for me!

提交回复
热议问题