[英]Pyinstaller is not executing my Python Script
When I open my created EXE file it will open the command prompt and not run the script, it use to give me an error message but I have done --debug-imports
and it doesn't give me the error but it still doesn't run the script当我打开我创建的 EXE 文件时,它将打开命令提示符而不运行脚本,它曾经给我一条错误消息但我已经完成了
--debug-imports
并且它没有给我错误但它仍然没有' t 运行脚本
Alone in the IDE, the script works fine but when it is made into an Executable it doesn't work.单独在 IDE 中,该脚本工作正常,但当它被制成可执行文件时,它不起作用。
(If this is a Duplicate please link me to the answered problem) (如果这是重复的,请将我链接到已回答的问题)
I am also creating the executable from an IDE (Pycharm)我还从 IDE (Pycharm) 创建可执行文件
I am using Python 3.9我正在使用 Python 3.9
This is my Script:这是我的脚本:
import pyautogui, time
from pynput.keyboard import Key, Controller
keyboard = Controller()
time.sleep(5)
f = open('beemovie', 'r')
for word in f:
pyautogui.typewrite(word)
pyautogui.press('enter')
You need to open powershell/cmd window in folder in which the script is by clicking shift+right click and selecting open powershell or command window here then write command 'pyinstaller filename.py' for files and for one.exe file write command 'pyinstaller --onefile filename.py' or if you want to hide the dialogue box coming so write 'pyinstaller --onefile -w filename.py'.i tried same python file but I think you should Import pyautogui您需要在脚本所在的文件夹中打开 powershell/cmd window,方法是单击 shift+右键单击并选择打开 powershell 或命令 window,然后在此处编写命令 for install 'pyinstaller filename 命令。 --onefile filename.py' 或者如果你想隐藏对话框,那么写'pyinstaller --onefile -w filename.py'。我尝试了相同的 python 文件,但我认为你应该导入 pyautogui
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.