Hi Patricial, I got the same problem too. And the attempts that I have tried based on the https://pyinstaller.org/en/stable/when-things-go-wrong.html do not work.
Have you figured out this error? Many thanks. Kind regards, Simon On Sunday, November 5, 2023 at 4:46:29 AM UTC+13 Patricia Kappler wrote: > <https://stackoverflow.com/posts/77416436/timeline> > > Hello! > > I want to make an executable file from my Python script (Python version > 3.11.5, Anaconda) using Pyinstaller. The main function of the script is to > access data from an excel file and provide this data in different files for > other scripts. When I run the script in Spyder it works totally fine. > However, if I use pyinstaller, the following error occurs: > > ImportError: Missing optional dependency 'openpyxl'. Use pip or conda to > install openpyxl. [24544] Failed to execute script 'mwe' due to unhandled > exception! > > > <https://stackoverflow.com/posts/77416436/timeline> > > I want to make an executable file from my Python script (Python version > 3.11.5, Anaconda) using Pyinstaller. The main function of the script is to > access data from an excel file and provide this data in different files for > other scripts. When I run the script in Spyder it works totally fine. > However, if I use pyinstaller, the following error occurs: > *ImportError: Missing optional dependency 'openpyxl'. Use pip or conda to > install openpyxl. [24544] Failed to execute script 'mwe' due to unhandled > exception! * > > I reinstalled openpyxl and also in Anaconda it is displayed as *installed*. > I further created a new environment as recommended in some other posts > about this problem. I tried pyinstaller --hidden-import openpyxl. > Furthermore I tried pyinstaller --name=mwe --onefile mwe.py and then to > add hiddenimports=[ 'openpyxl']' to the resulting mwe.spec file. But > nothing worked so far. > The main function of my python script to access an excel file and print > the data in a new txt file: > > import pandas as pd > > obs = (pd.read_excel('FINIFLUX.xlsx', usecols='F', header=2)).dropna() > > np.savetxt('observation_points.txt', obs) > > > As I am pretty new to Python and especially to pyinstaller, I would be > glad if somenone could help me! > -- You received this message because you are subscribed to the Google Groups "PyInstaller" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To view this discussion on the web visit https://groups.google.com/d/msgid/pyinstaller/725e258c-b5b3-44a3-995b-ca5736e0c139n%40googlegroups.com.
