나는 다음과 같은 수입이 "hello.py"
라는 .py
파일을 만든 :'모듈'개체가 어떤 속성 '지역 주민없는'
from setuptools import setup,Extension
from Cython.Build import cythonize
setup(name = 'increment app',ext_modules = cythonize("hello.pyx"))
내가 얻고이를 실행하는 동안 :
AttributeError를 ' module '객체에'locals '속성이 없습니다.
저는 Visual Studio C++ 2008
버전으로 작업하고 있습니다.
명령 프롬프트 pip install cython
은 오류가 발생하지 않았지만 cython도 다운로드하거나 설치하지 않았습니다.
@DavidW 여기
AttributeErrorTraceback (most recent call last)
C:\SPB_Data\setup.py in <module>()
1 from setuptools import setup,Extension
----> 2 from Cython.Build import cythonize
3 setup(name = 'increment app',ext_modules = cythonize("hello.pyx"))
C:\Users\kalachand\AppData\Local\Enthought\Canopy32\edm\envs\User\lib\site-packages\Cython\Build\__init__.py in <module>()
----> 1 from .Dependencies import cythonize
2 from .Distutils import build_ext
C:\Users\kalachand\AppData\Local\Enthought\Canopy32\edm\envs\User\lib\site-packages\Cython\Build\Dependencies.py in <module>()
176
177
--> 178 @cython.locals(start=cython.Py_ssize_t, end=cython.Py_ssize_t)
179 def line_iter(source):
180 if isinstance(source, basestring):
AttributeError: 'module' object has no attribute 'locals'
추적 표시를 추가 할 수 있습니까? 오류가 발생한 위치를 확인하는 것이 유용 할 수 있습니다. – DavidW
@DavidW 답변 섹션에서 원하는 전체 추적을 참조하십시오. 또한, 내가 당신에게 연락 할 수있는 방법이있어서 전체 과정을 도와 줄 수 있습니다. 1.5 일 동안 똑바로 붙어 있습니다. 그것은 15 분 이상 걸리지 않습니다. 고맙습니다. –
이런 종류의 문제는 항상 고칠 수 없으며 (실제로 어떻게 해야할지 잘 모르겠습니다). [cython]이라는 또 다른 모듈을 만들 수 있었습니까? (https://stackoverflow.com/a/15130088/4657412) -'import cython; print (cython .__ 파일 __)'. – DavidW