<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/1998a1cf-6ce9-4491-a472-dcfab3626ebbn%40googlegroups.com.

Reply via email to