を使用する非常に単純なcythonコードがありますprange
。これは、Linuxで正常に機能します。しかし、私がWindowsでそれをやろうとすると。コンパイルはできるがインポートできないという問題が発生しました。
ImportError: DLL load failed: This application has failed to start because the a
pplication configuration is incorrect. Reinstalling the application may fix this
problem.
また、ウィンドウズではできませんfrom cython.parallel import threadlocal
か?!変...
誰かが方向を示すことができますか?
システムは正常に動作します:linux64、コンパイラgcc、パッケージ:Python 2.7、cython 0.16
システムに問題があります:Win64、コンパイラ:MSVC VS2008、パッケージ:Python 2.7、cython 0.16
これが私の単純なcythonpyxです:
cimport cython
from cython.parallel import prange
def f(int n):
cdef int i
cdef int sum = 0
for i in prange(n, nogil=True):
sum += i
print sum
これが私のsetup.pyです:
from distutils.core import setup
from distutils.extension import Extension
from Cython.Distutils import build_ext
import numpy as np
setup(
cmdclass = {'build_ext': build_ext},
include_dirs = [np.get_include()],
ext_modules = [Extension("pcython1", ["pcython1.pyx"],extra_compile_args=['/openmp',],),]
)