为什么`setup.py develop`无法运行?

8

我想以开发模式安装我的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吗?
1个回答

12

develop 命令是 setuptools 的一部分。请安装 setuptools 并将 setup.py 文件中的第一行替换为以下内容:

from setuptools import setup

网页内容由stack overflow 提供, 点击上面的
可以查看英文原文,
原文链接