Reputation: 315
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
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
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