Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/python/339.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
cx#u Freeze:Python主脚本错误-modulenofounderror:没有名为';scipy.spatial.ckdtree_Python_Scipy_Cx Freeze - Fatal编程技术网

cx#u Freeze:Python主脚本错误-modulenofounderror:没有名为';scipy.spatial.ckdtree

cx#u Freeze:Python主脚本错误-modulenofounderror:没有名为';scipy.spatial.ckdtree,python,scipy,cx-freeze,Python,Scipy,Cx Freeze,在cx_Freeze基于我的Python代码构建了一个可执行文件之后,我遇到了以下错误 C:\Users\MAIN\Desktop\NEW\build\exe.win-amd64-3.7>GUI-Peak-Analysis Traceback (most recent call last): File "C:\Users\MAIN\AppData\Local\Programs\Python\Python37\lib\site-packages\cx_Freeze\initscripts\_

在cx_Freeze基于我的Python代码构建了一个可执行文件之后,我遇到了以下错误

C:\Users\MAIN\Desktop\NEW\build\exe.win-amd64-3.7>GUI-Peak-Analysis
Traceback (most recent call last):
File "C:\Users\MAIN\AppData\Local\Programs\Python\Python37\lib\site-packages\cx_Freeze\initscripts\__startup__.py", line 40, in run
module.run()
File "C:\Users\MAIN\AppData\Local\Programs\Python\Python37\lib\site-packages\cx_Freeze\initscripts\Console.py", line 37, in run
exec(code, {'__name__': '__main__'})
File "GUI-Peak-Analysis.py", line 6, in <module>
File "C:\Users\MAIN\Desktop\NEW\Goldindec.py", line 11, in <module>
from scipy.interpolate import interp1d  ## to smooth spectrum
File "C:\Users\MAIN\AppData\Local\Programs\Python\Python37\lib\site-packages\scipy\interpolate\__init__.py", line 167, in <module>
from .interpolate import *
File "C:\Users\MAIN\AppData\Local\Programs\Python\Python37\lib\site-packages\scipy\interpolate\interpolate.py", line 26, in <module>
from .interpnd import _ndim_coords_from_arrays
File "interpnd.pyx", line 1, in init scipy.interpolate.interpnd
File "C:\Users\MAIN\AppData\Local\Programs\Python\Python37\lib\site-packages\scipy\spatial\__init__.py", line 100, in <module>
from .ckdtree import *
ModuleNotFoundError: No module named 'scipy.spatial.ckdtree'

尝试执行一行python脚本(如果失败,请执行pip安装scipy并重做):从scipy.spatial.ckdtree import*

大部分scipy是用C/C++编写的。您的构建是在其他地方还是以前工作过?@ShpielMeister noI使用以下代码创建了一个单行python文件:from scipy.spatial.ckdtree import*。我使用cx\u Freeze基于这一行python脚本构建可执行文件。当我打开可执行文件时,一个控制台窗口出现,几秒钟后消失。从命令提示符运行程序时,遇到以下错误:ModuleNotFoundError:没有名为“scipy.spatial.ckdtree”的模块。失败后,我安装了scipy并重新定义了流程。我还是有同样的问题,让我们看看你的路。只需尝试将scipy作为一个单一行导入即可。另外,让我们检查一下您的python::which-a python
import sys
from cx_Freeze import setup, Executable

# Dependencies are automatically detected, but it might need fine tuning.
build_exe_options = {"packages": ["os", "astropy", "matplotlib", "numpy", "pyqt5", "scipy"], 
                     "excludes": ["tkinter"]}

# GUI applications require a different base on Windows (the default is for a
# console application).
base = None
#if sys.platform == "win32":
#    base = "Win32GUI"

setup(  name = "GUI-Peak-Analysis",
        version = "0.1",
        description = "My GUI application!",
        options = {"build_exe": build_exe_options},
        executables = [Executable("GUI-Peak-Analysis.py", base=base)])