Creating Pyinstaller .exe with OpenAI API imported

I am trying to create a pyinstaller onefile .exe with the OpenAI API imported. The script runs in Idle, but when I create the executable, the script doesn’t run. Can someone help guide me through the steps required to create a pyinstaller .exe with the OpenAI API imported?

Command prompt
Pyinstaller -F —-onefile —-windowed “file path.pyw”