Search code examples
pythonexepyinstallerpy2execx-freeze

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.


Solution

  • 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.