为什么setup.py开发不起作用? [英] Why does `setup.py develop` not work?

查看:140
本文介绍了为什么setup.py开发不起作用?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想在开发模式下安装我的Python模块。正如我在许多示例中看​​到的, python setup.py development 应该可以做到这一点。但是我的 setup.py 文件没有 develop 命令:

I would like to install my Python module in development mode. As I have seen in many examples python setup.py develop is supposed to do that. But the develop command does not exist for my setup.py file:

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扩展模块)。

(Note the Cython extension module).

我想念什么?我需要修改 setup.py 吗?

What am I missing? Do I need to modify the setup.py?

推荐答案

code> develop 命令是设置工具。安装setuptools并将 setup.py 中的第一行替换为:

The develop command is a part of setuptools. Install setuptools and replace the first line in setup.py with this:

from setuptools import setup

这篇关于为什么setup.py开发不起作用?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆