Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/python/327.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
正在开发中安装Python/Cython(扩展)模块_Python_Cython_Distutils_Setup.py - Fatal编程技术网

正在开发中安装Python/Cython(扩展)模块

正在开发中安装Python/Cython(扩展)模块,python,cython,distutils,setup.py,Python,Cython,Distutils,Setup.py,我一直在研究一个包含Cython的C++扩展的Python模块。setup.py当前处理扩展模块的构建,称为python3 setup.py--build\u ext--inplace from distutils.core import setup from distutils.extension import Extension from Cython.Build import cythonize from Cython.Distutils import build_ext srcDir

我一直在研究一个包含Cython的C++扩展的Python模块。
setup.py
当前处理扩展模块的构建,称为
python3 setup.py--build\u ext--inplace

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


srcDir = "../src"
src = ["_MyProject.pyx"]    # list of source files

print("source files: {0}".format(src))

modules = [Extension("_MyProject",
                    src,
                    language = "c++",
                    extra_compile_args=["-fopenmp", "-std=c++11", "-O3", "-DNOGTEST"],
                    extra_link_args=["-fopenmp", "-std=c++11"],
                    libraries=["MyProjectLib", "log4cxx"],
                    library_dirs=["../"])]

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

setup(name="_MyProject",
     cmdclass={"build_ext": build_ext},
     ext_modules=modules)
在Cython模块
\u MyProject
之上,有一个纯Python模块
MyProject
,它从
\u MyProject
导入内容


目前,我通过
cd
-ing将模块导入其目录并从那里导入来使用和测试该模块。我需要如何修改我的
setup.py
,以便将
MyProject
安装到我的站点软件包中,并使软件包始终处于最新状态?

将参数
py_modules=[“MyProject.py”,]
添加到您的设置()中函数。

如果我正确理解了这个问题,我将使用virtualenv和python setup.py develope进行此操作-请参阅,完成此操作后,我需要如何调用
setup.py
以实现所需的安装?