我正在尝试使用pyinstaller将.py格式转换为.exe格式。 这是我试图转换的.py
import pandas as pd
import os
import glob
import re
import csv
#import time
rows = []
d = {}
user_input = raw_input("Enter the path of your file: ")
#path = 'O:\People\Aravind_Sampathkumar\Logs'
for filename in glob.glob(os.path.join(user_input, '*.log')):
r = re.compile(r'(\w+)\s+(-?\d+(?:\.\d+)?(?:e[+\-]?\d+)?)') # into 2 groups
d = dict(r.findall(open(filename, 'r').read()))
d['filename'] = filename
rows.append(d)
df = pd.DataFrame(rows)
df.to_csv('data.csv', columns=['COM','eh','ehc','ew','oeh','sp_icr','sp_il','filename'])
print "done!"
正在运行pyinstaller --onefile
c:\Users\Aravind_Sampathkumar\Desktop\PY\ParseTextToExcel.py
我的.exe文件已创建,但是当我尝试执行它时,它会因此错误而失败
为什么会抛出此错误? .py似乎工作正常