无法从.py生成.exe。PyQt5包可能存在问题?

2024-09-27 17:34:40 发布

您现在位置:Python中文网/ 问答频道 /正文

我有一段用python编写的代码,我想在.exe中执行。这是一个非常简单的代码,只使用了以下库:

import os
import pandas as pd

基本上,程序从multiples.xlsx文件中读取某一列,并将其复制到其他Excel文件中。少于20行

if os.path.exists("Gust_32_42.xlsx"):
  os.remove("Gust_32_42.xlsx")

document=[]
print('.xlsx or .xls')
ext=input()
for f in os.listdir():
    if f.endswith(ext):
        document.append(f)

GranDF=pd.DataFrame(columns=document)

for i in document:
    df = pd.read_excel(i, columns=['1','2'])
    GranDF[i]=df['Generator electric power\' (MW)']

GranDF.to_excel('Gust_32_42.xlsx')

我安装了pyinstaller来将其他.py转换为.exe,直到现在我已经有了thoses库,我还没有尝试过任何问题

pyinstaller遵循的过程可在此处阅读:

https://pastebin.com/GFwQttmJ

我在安装PyQt5软件包方面取得了进展(我不知道为什么…),但生成的.exe没有任何作用,因为我已经安装了PyQt5,所以无法打开Spyder

你知道为什么会这样吗

多谢各位


Tags: columns文件代码inimportforifos

热门问题