pandas RuntimeError:input():losed sys.stdin -如果我运行.exe文件,但能够在pycharm中使用.py运行,我会得到这个错误

v1l68za4  于 2023-06-20  发布在  PyCharm
关注(0)|答案(1)|浏览(141)

我正在学习Python。我有一个python脚本,可以从用户那里获取输入。如果我在pycharm中运行这个脚本,我将得到所需的输出,但得到的是"RuntimeError: input(): lost sys.stdin" this error in .exe file which I converter with pyinstaller.
请指导我如何运行我的.exe文件与用户输入。下面是我的代码

import pandas as pd
import openpyxl
import sys

downloaded_file = input("Enter Downloaded file name: ")
customer_file = input("Enter Customer file name: ")

df_portal = pd.read_excel(f"{downloaded_file}.xls")

df_customer_zyme = pd.read_excel(f"{customer_file}.xlsx")
6yt4nkrj

6yt4nkrj1#

您可能需要使用“console”选项构建您的pyinstaller:
https://pyinstaller.org/en/stable/usage.html#cmdoption-c

相关问题