Jaime Miranda Ramirez
Jaime Miranda Ramirez

Reputation: 315

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:

ModuleNotFoundError: No module named 'pandas'

[11084] Failed to execute script 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. I've tried with cx_Freeze, PyInstaller, py2exe, and auto-py-to-exe. All give me a ModuleNotFoundError, but when I run the script on the IDE it runs perfectly.

Upvotes: 0

Views: 4407

Answers (3)

tan_an
tan_an

Reputation: 196

For cx_freeze, inlcude pandas explicitly in the packages. Like in the example below -

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

This should include the pandas module in you build.

Upvotes: 1

Vijay
Vijay

Reputation: 61

A script that runs in your IDE but not outside may mean you are actually working in a virtual environment. Pandas probably is not installed globally in your system. Try remembering if you had created a virtual environment and then installed pandas inside this virtual environment.

Hope it helped,
Vijay.

Upvotes: 2

popstas
popstas

Reputation: 41

Are you trying pip install pandas?

Upvotes: 2

Related Questions