简体   繁体   English

ModuleNotFoundError:使用 auto-py-to-exe 将 Python 文件转换为可执行文件时没有名为“pandas”的模块

[英]ModuleNotFoundError: No module named 'pandas' when converting Python file to Executable using auto-py-to-exe

I used auto-py-to-exe to convert a Python script into an executable file and it converts it to an executable without any problems, but when I launch the executable the following error happens:我使用 auto-py-to-exe 将 Python 脚本转换为可执行文件,并将其转换为可执行文件而没有任何问题,但是当我启动可执行文件时会发生以下错误:

ModuleNotFoundError: No module named 'pandas' ModuleNotFoundError:没有名为“熊猫”的模块

[11084] Failed to execute script test1 [11084] 无法执行脚本 test1

Any ideas on how to fix this?有想法该怎么解决这个吗? I've tried many libraries to convert the Python file to and Executable and all give me the same error.我尝试了许多库来将 Python 文件转换为可执行文件,并且都给了我同样的错误。 I've tried with cx_Freeze, PyInstaller, py2exe, and auto-py-to-exe.我尝试过使用 cx_Freeze、PyInstaller、py2exe 和 auto-py-to-exe。 All give me a ModuleNotFoundError , but when I run the script on the IDE it runs perfectly.都给了我一个ModuleNotFoundError ,但是当我在 IDE 上运行脚本时,它运行得很好。

Are you trying pip install pandas ?你在尝试pip install pandas吗?

A script that runs in your IDE but not outside may mean you are actually working in a virtual environment.在 IDE 中运行但不在外部运行的脚本可能意味着您实际上是在虚拟环境中工作。 Pandas probably is not installed globally in your system. Pandas 可能未在您的系统中全局安装。 Try remembering if you had created a virtual environment and then installed pandas inside this virtual environment.试着记住你是否创建了一个虚拟环境,然后在这个虚拟环境中安装了 pandas。

Hope it helped,希望有帮助,
Vijay.维杰。

For cx_freeze, inlcude pandas explicitly in the packages.对于 cx_freeze,在包中明确包含 pandas。 Like in the example below -就像下面的例子一样 -

build_exe_options = {'packages': ['os', 'tkinter', 'pandas']} build_exe_options = {'packages': ['os', 'tkinter', 'pandas']}

This should include the pandas module in you build.这应该包括您构建的 pandas 模块。

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

相关问题 没有名为“pandas”的模块 auto-py-to-exe - No module named 'pandas' auto-py-to-exe IndexError:当我尝试使用 auto-py-to-exe 从 python 脚本创建可执行文件时,元组索引超出范围 - IndexError: tuple index out of range when I try to create an executable from a python script using auto-py-to-exe 使用 auto-py-to-exe 将任何 python 文件转换为 exe 时出错 - Getting error while converting any python file to exe with auto-py-to-exe auto-py-to-exe:未找到模块请求 - auto-py-to-exe : module requests not found 使用 auto-py-to-exe 无法将.py 转换为 exe - Trouble Converting .py to ,exe with auto-py-to-exe Auto-Py-To-Exe - win32api - ModuleNotFoundError - Auto-Py-To-Exe - win32api - ModuleNotFoundError 在Windows上安装Python 3.7的auto-py-to-exe模块会在Windows上返回错误 - Installing auto-py-to-exe module for Python 3.7 returns an error on Windows 自动 Py-to-Exe | 签署 Windows EXE 文件 - Auto-Py-to-Exe | Signing a Windows EXE file “模块'eel.chrome'”的自动py到exe问题 - auto-py-to-exe problem with "module 'eel.chrome'" 当我尝试使用auto-py-to-exe将其转换为独立应用程序时,我的代码(python)出了什么问题? - What is going wrong with my code(python) when I try to convert it into a stand alone application using auto-py-to-exe
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM