Windows에서 .pyx로 저장 한 Cython 파일 (.pyx)을 컴파일하려고합니다. 여기 내 프로젝트 디렉토리 경로입니다.Cython 컴파일 오류가 "유효한 모듈 이름이 아닙니다."
c:\..\Project\App\Analyzer\
_init_.py
Few_other_files.py
consolidated_loop_C.pyx
cl_setup.py
는 여기에 내가 같은 폴더에 compling을 위해 문 아래 사용하고 내 cl_setup.py
from Cython.Build import cythonize
try:
from setuptools import setup
from setuptools import Extension
except ImportError:
from distutils.core import setup
from distutils.extension import Extension
setup(
name = "Consolidated Loop",
ext_modules = cythonize("consolidated_loop_C.pyx")
)
입니다.
python cl_setup.py build_ext --inplace
하지만 아래 오류가 나타납니다. 내 생각 엔 cythonize()에 특정 매개 변수가 누락되어 행운없이 연구하려고했습니다.
경로에서 대시를 찾아서 그것에 대해 불만을 토로하고 있습니다 (동일한 문제는 http://stackoverflow.com/questions/32799506/something-wrong-when-i-compile-cython-with-c 참조). 왜 정확히 그것을하고 있는지 나는 잘 모르겠습니다. 간단한 해결책은 디렉토리의 이름을 바꾸는 것입니다 (하지만 실제로는 적절한 해결책이 아닙니다. 그렇게하지 않아도됩니다). – DavidW
@DavidW 예, 폴더 이름에 대시가 맞았습니다. 지금은 폴더의 이름을 바꿨습니다. 감사. – PyRaider