【问题标题】:Why does `setup.py develop` not work?为什么`setup.py develop` 不起作用?
【发布时间】:2014-01-26 14:41:07
【问题描述】:

我想在开发模式下安装我的 Python 模块。正如我在许多示例中看​​到的那样,python setup.py develop 应该这样做。但是我的setup.py 文件不存在develop 命令:

from distutils.core import setup
from distutils.extension import Extension
from Cython.Build import cythonize
from Cython.Distutils import build_ext

import os

src = ["_NetworKit.pyx"]    # list of source files
modules = [Extension("_NetworKit",
                    src,
                    language = "c++",
                    extra_compile_args=["-fopenmp", "-std=c++11", "-O3", "-DNOGTEST"],
                    extra_link_args=["-fopenmp", "-std=c++11"],
                    libraries=["NetworKit-Core-O"],
                    library_dirs=["../"])]

for e in modules:
    e.cython_directives = {"embedsignature" : True}

setup(name="_NetworKit",
     cmdclass={"build_ext": build_ext},
     ext_modules=modules,
     py_modules = ["NetworKit.py"])

(注意 Cython 扩展模块)。

我错过了什么?我需要修改setup.py吗?

【问题讨论】:

    标签: python python-3.x cython distutils setup.py


    【解决方案1】:

    develop 命令是setuptools 的一部分。安装 setuptools 并将setup.py 中的第一行替换为:

    from setuptools import setup
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2018-07-31
      • 2018-02-06
      • 1970-01-01
      • 1970-01-01
      • 2013-12-18
      相关资源
      最近更新 更多