简体   繁体   English

为什么`setup.py develop`不起作用?

[英]Why does `setup.py develop` not work?

I would like to install my Python module in development mode. 我想在开发模式下安装我的Python模块。 As I have seen in many examples python setup.py develop is supposed to do that. 正如我在许多例子中看到的那样, python setup.py develop应该这样做。 But the develop command does not exist for my setup.py file: 但是我的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"])

(Note the Cython extension module). (注意Cython扩展模块)。

What am I missing? 我错过了什么? Do I need to modify the setup.py ? 我需要修改setup.py吗?

The develop command is a part of setuptools . develop命令是setuptools的一部分。 Install setuptools and replace the first line in setup.py with this: 安装setuptools并将setup.py的第一行替换为:

from setuptools import setup

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM