简体   繁体   English

.PYX档案未找到(Cython)

[英].PYX file not found (Cython)

"C:\\Users\\Sameer Khanna\\Anaconda3\\python.exe" "C:/Users/Sameer Khanna/Desktop/NPann-dce_wrist-db62618c97ac/ex_process_dce_roiwise.py" Traceback (most recent call last): File "C:\\Users\\Sameer Khanna\\Anaconda3\\lib\\site-packages\\pyximport\\pyximport.py", line 209, in load_module inplace=build_inplace, language_level=language_level) File "C:\\Users\\Sameer Khanna\\Anaconda3\\lib\\site-packages\\pyximport\\pyximport.py", line 186, in build_module reload_support=pyxargs.reload_support) File "C:\\Users\\Sameer Khanna\\Anaconda3\\lib\\site-packages\\pyximport\\pyxbuild.py", line 100, in pyx_to_dll dist.run_commands() File "C:\\Users\\Sameer Khanna\\Anaconda3\\lib\\distutils\\dist.py", line 955, in run_commands self.run_command(cmd) File "C:\\Users\\Sameer Khanna\\Anaconda3\\lib\\distutils\\dist.py", line 974, in run_command cmd_obj.run() File "C:\\Users\\Sameer Khanna\\Anaconda3\\lib\\site-packages\\Cython\\Distutils\\build_ext.py", line 164, in run _build_ext.build_ext.run(self) File "C:\\Users\\Sameer Khanna\\Anaconda3\\lib\\distu “ C:\\ Users \\ Sameer Khanna \\ Anaconda3 \\ python.exe”“ C:/ Users / Sameer Khanna / Desktop / NPann-dce_wrist-db62618c97ac / ex_process_dce_roiwise.py”追溯(最近一次调用):文件“ C:\\ Users \\ Sameer Khanna \\ Anaconda3 \\ lib \\ site-packages \\ pyximport \\ pyximport.py“,第209行,位于load_module inplace = build_inplace,language_level = language_level)文件“ C:\\ Users \\ Sameer Khanna \\ Anaconda3 \\ lib \\ site-packages \\ pyximport \\ pyximport.py”,第186行,位于build_module reload_support = pyxargs.reload_support中)文件“ C:\\ Users \\ Sameer Khanna \\ Anaconda3 \\ lib \\ site-packages \\ pyximport \\ pyxbuild.py”,第100行,位于pyx_to_dll dist中。 run_commands()文件“ C:\\ Users \\ Sameer Khanna \\ Anaconda3 \\ lib \\ distutils \\ dist.py”,行955,在run_commands self.run_command(cmd)文件“ C:\\ Users \\ Sameer Khanna \\ Anaconda3 \\ lib \\ distutils \\ dist.py”,第974行,在run_command cmd_obj.run()中,文件“ C:\\ Users \\ Sameer Khanna \\ Anaconda3 \\ lib \\ site-packages \\ Cython \\ Distutils \\ build_ext.py”,第164行,在运行_build_ext中。 build_ext.run(self)文件“ C:\\ Users \\ Sameer Khanna \\ Anaconda3 \\ lib \\ distu tils\\command\\build_ext.py", line 338, in run self.build_extensions() File "C:\\Users\\Sameer Khanna\\Anaconda3\\lib\\site-packages\\Cython\\Distutils\\build_ext.py", line 172, in build_extensions self.build_extension(ext) File "C:\\Users\\Sameer Khanna\\Anaconda3\\lib\\distutils\\command\\build_ext.py", line 532, in build_extension depends=ext.depends) File "C:\\Users\\Sameer Khanna\\Anaconda3\\lib\\distutils_msvccompiler.py", line 315, in compile self.initialize() File "C:\\Users\\Sameer Khanna\\Anaconda3\\lib\\distutils_msvccompiler.py", line 208, in initialize vc_env = _get_vc_env(plat_spec) File "C:\\Users\\Sameer Khanna\\Anaconda3\\lib\\distutils_msvccompiler.py", line 81, in _get_vc_env vcvarsall, vcruntime = _find_vcvarsall(plat_spec) File "C:\\Users\\Sameer Khanna\\Anaconda3\\lib\\distutils_msvccompiler.py", line 34, in _find_vcvarsall access=winreg.KEY_READ | tils \\ command \\ build_ext.py”,第338行,在运行self.build_extensions()文件“ C:\\ Users \\ Sameer Khanna \\ Anaconda3 \\ lib \\ site-packages \\ Cython \\ Distutils \\ build_ext.py”,第172行,在build_extensions self.build_extension(ext)文件“ C:\\ Users \\ Sameer Khanna \\ Anaconda3 \\ lib \\ distutils \\ command \\ build_ext.py”,第532行,位于build_extensionDepend = ext.depends)文件“ C:\\ Users \\ Sameer Khanna编译self.initialize()文件中的\\ Anaconda3 \\ lib \\ distutils_msvccompiler.py“行315,初始化vc_env = _get_vc_env(plat_spec)中的文件” C:\\ Users \\ Sameer Khanna \\ Anaconda3 \\ lib \\ distutils_msvccompiler.py“行208 _get_vc_env vcvarsall,vcruntime = _find_vcvarsall(plat_spec)中的文件“ C:\\ Users \\ Sameer Khanna \\ Anaconda3 \\ lib \\ distutils_msvccompiler.py”,第81行,文件“ C:\\ Users \\ Sameer Khanna \\ Anaconda_ms” \\ lib \\ distutils。 _find_vcvarsall access = winreg中,第34行。 winreg.KEY_WOW64_32KEY FileNotFoundError: [WinError 2] The system cannot find the file specified winreg.KEY_WOW64_32KEY FileNotFoundError:[WinError 2]系统找不到指定的文件

During handling of the above exception, another exception occurred: 在处理上述异常期间,发生了另一个异常:

Traceback (most recent call last): File "C:/Users/Sameer Khanna/Desktop/NPann-dce_wrist-db62618c97ac/ex_process_dce_roiwise.py", line 7, in from compartmentmodels.compartmentmodels import TwoCXModel, TwoCUModel, CompartmentModel, ModifiedTofts File "C:\\Users\\Sameer Khanna\\Desktop\\NPann-dce_wrist-db62618c97ac\\compartmentmodels\\compartmentmodels.py", line 13, in from . 追溯(最近一次通话最近):文件“ C:/ Users / Sameer Khanna / Desktop / NPann-dce_wrist-db62618c97ac / ex_process_dce_roiwise.py”,第7行,来自spacermodels.compartmentmodels导入TwoCXModel,TwoCUModel,CompartmentModel,ModifiedTofts文件“ C :\\ Users \\ Sameer Khanna \\ Desktop \\ NPann-dce_wrist-db62618c97ac \\ compartmentmodels \\ compartmentmodels.py”,第13行,来自。 import c_convolution_exp File "C:\\Users\\Sameer Khanna\\Anaconda3\\lib\\site-packages\\pyximport\\pyximport.py", line 435, in load_module language_level=self.language_level) File "C:\\Users\\Sameer Khanna\\Anaconda3\\lib\\site-packages\\pyximport\\pyximport.py", line 225, in load_module raise exc.with_traceback(tb) File "C:\\Users\\Sameer Khanna\\Anaconda3\\lib\\site-packages\\pyximport\\pyximport.py", line 209, in load_module inplace=build_inplace, language_level=language_level) File "C:\\Users\\Sameer Khanna\\Anaconda3\\lib\\site-packages\\pyximport\\pyximport.py", line 186, in build_module reload_support=pyxargs.reload_support) File "C:\\Users\\Sameer Khanna\\Anaconda3\\lib\\site-packages\\pyximport\\pyxbuild.py", line 100, in pyx_to_dll dist.run_commands() File "C:\\Users\\Sameer Khanna\\Anaconda3\\lib\\distutils\\dist.py", line 955, in run_commands self.run_command(cmd) File "C:\\Users\\Sameer Khanna\\Anaconda3\\lib\\distutils\\dist.py", line 974, in run_command cmd_obj.run() File "C:\\Users\\Sameer Khanna\\Anaconda3\\lib\\site-pa 导入c_convolution_exp文件“ C:\\ Users \\ Sameer Khanna \\ Anaconda3 \\ lib \\ site-packages \\ pyximport \\ pyximport.py”,行435,在load_module language_level = self.language_level中)文件“ C:\\ Users \\ Sameer Khanna \\ Anaconda3 \\ lib \\ site-packages \\ pyximport \\ pyximport.py“,第225行,在load_module中,提高了exc.with_traceback(tb)文件” C:\\ Users \\ Sameer Khanna \\ Anaconda3 \\ lib \\ site-packages \\ pyximport \\ pyximport.py“,第209行,在load_module inplace = build_inplace,language_level = language_level)文件“ C:\\ Users \\ Sameer Khanna \\ Anaconda3 \\ lib \\ site-packages \\ pyximport \\ pyximport.py”,在第186行,在build_module reload_support = pyxargs.reload_support)文件“ C:\\ Users \\ Sameer Khanna \\ Anaconda3 \\ lib \\ site-packages \\ pyximport \\ pyxbuild.py”,第100行,在pyx_to_dll dist.run_commands()文件中,“ C:\\ Users \\ Sameer Khanna \\ Anaconda3 \\ lib \\ distutils \\ dist.py”,第955行,在run_commands self.run_command(cmd)文件中,“ C:\\ Users \\ Sameer Khanna \\ Anaconda3 \\ lib \\ distutils \\ dist.py”,第974行,在run_commands cmd_obj.run()文件中:\\ Users \\ Sameer Khanna \\ Anaconda3 \\ lib \\ site-pa ckages\\Cython\\Distutils\\build_ext.py", line 164, in run _build_ext.build_ext.run(self) File "C:\\Users\\Sameer Khanna\\Anaconda3\\lib\\distutils\\command\\build_ext.py", line 338, in run self.build_extensions() File "C:\\Users\\Sameer Khanna\\Anaconda3\\lib\\site-packages\\Cython\\Distutils\\build_ext.py", line 172, in build_extensions self.build_extension(ext) File "C:\\Users\\Sameer Khanna\\Anaconda3\\lib\\distutils\\command\\build_ext.py", line 532, in build_extension depends=ext.depends) File "C:\\Users\\Sameer Khanna\\Anaconda3\\lib\\distutils_msvccompiler.py", line 315, in compile self.initialize() File "C:\\Users\\Sameer Khanna\\Anaconda3\\lib\\distutils_msvccompiler.py", line 208, in initialize vc_env = _get_vc_env(plat_spec) File "C:\\Users\\Sameer Khanna\\Anaconda3\\lib\\distutils_msvccompiler.py", line 81, in _get_vc_env vcvarsall, vcruntime = _find_vcvarsall(plat_spec) File "C:\\Users\\Sameer Khanna\\Anaconda3\\lib\\distutils_msvccompiler.py", line 34, in _find_vcvarsall access=winreg.KEY_READ | 在运行_build_ext.build_ext.run(self)文件“ C:\\ Users \\ Sameer Khanna \\ Anaconda3 \\ lib \\ distutils \\ command \\ build_ext.py”中,行338中的ckages \\ Cython \\ Distutils \\ build_ext.py”,第164行,在运行self.build_extensions()文件“ C:\\ Users \\ Sameer Khanna \\ Anaconda3 \\ lib \\ site-packages \\ Cython \\ Distutils \\ build_ext.py”的行172中,在build_extensions self.build_extension(ext)文件“ C:\\在build_extensionDepend = ext.depends中,Users \\ Sameer Khanna \\ Anaconda3 \\ lib \\ distutils \\ command \\ build_ext.py”,行532)文件“ C:\\ Users \\ Sameer Khanna \\ Anaconda3 \\ lib \\ distutils_msvccompiler.py”,行315 ,在编译self.initialize()文件“ C:\\ Users \\ Sameer Khanna \\ Anaconda3 \\ lib \\ distutils_msvccompiler.py”中,第208行,在初始化vc_env = _get_vc_env(plat_spec)文件“ C:\\ Users \\ Sameer Khanna \\ Anaconda3 \\ “ lib \\ distutils_msvccompiler.py”,在_get_vc_env vcvarsall中,第81行,vcruntime = _find_vcvarsall(plat_spec)文件“ C:\\ Users \\ Sameer Khanna \\ Anaconda3 \\ lib \\ distutils_msvccompiler.py”,在第34行,在_find_vc中的regKEY。 winreg.KEY_WOW64_32KEY ImportError: Building module compartmentmodels.c_convolution_exp failed: ['FileNotFoundError: [WinError 2] The system cannot find the file specified\\n'] winreg.KEY_WOW64_32KEY ImportError:构建模块spacermodels.c_convolution_exp失败:['FileNotFoundError:[WinError 2]系统找不到指定的文件\\ n']

Process finished with exit code 1 流程以退出代码1完成

I get the above error message when trying to use pyximport on Windows. 尝试在Windows上使用pyximport时,出现上述错误消息。 I am also unable to go through the Cython tutorial, being unable to perform the setup.py and pyximport methods. 我也无法阅读Cython教程,无法执行setup.py和pyximport方法。

I downloaded PyCharm and Anaconda 3.5 我下载了PyCharm和Anaconda 3.5

What am I doing wrong? 我究竟做错了什么?

Are you sure that the .pyx file location is in your current directory or PYTHONPATH? 您确定.pyx文件位置在当前目录或PYTHONPATH中吗?

Eg, try to create a file helloworld.pyx with the following contents: 例如,尝试使用以下内容创建文件helloworld.pyx

cimport cython
cpdef hello_world():
    return 'Hello, World'

save it in the directory from which you started your python interpreter. 将其保存在启动python解释器的目录中。

and run 并运行

>>> import pyximport; pyximport.install()
>>> import helloworld
>>> helloworld.hello_world()
'Hello, World'

Alternatively, you can save helloworld.pyx somewhere else and add this directory to your PYTHONPATH, eg, 或者,您可以将helloworld.pyx保存helloworld.pyx其他位置,然后将此目录添加到您的PYTHONPATH中,例如,

>>> import sys
>>> sys.path.insert(0, '/Users/Sebastian/Desktop')

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM