저는 파이썬 (pyodbc
및 tkinter
)으로 프로그램을 작성했습니다. pyodbc
을 사용하여 Microsoft Access 데이터베이스에 연결했습니다.PyInstaller로 컴파일 한 후 시작시 오류 수정 방법 pyodbc가 있습니까?
import pyodbc
# Microsoft Access Database File
DBfile = 'GDP.mdb'
conn = pyodbc.connect('DRIVER={Microsoft Access Driver (*.mdb)};DBQ='+DBfile)
내가 명령 프롬프트 (python myprogram.py
)에서 컴파일하기 전에를 시작 아주 잘 작동 :
연결 코드가있다. pyinstaller
으로 컴파일 할 때 오류는보고되지 않습니다.
하지만 executabl을 실행하려고하면 2 초 동안 기본 창이 표시되고 사라집니다. , 가지고 새로운
Traceback (most recent call last):
File "<string>", line 62, in <module>
pyodbc.Error: (
'HY000', "[HY000] [Microsoft][Driver ODBC Microsoft Access]
Can't find File'(Unknown)'.
(-1811) (SQLDriverConnect); [HY000] [Microsoft][Driver ODBC Microsoft Access]
Can't find File'(Unknown)'.
(-1811)")
RC: -1 from main
편집
가 첫 번째 오류 사라 : 나는 그것을 실행 파일을 실행 다음과 같은 오류를 보여줍니다 디버그 모드를 켭니다 pyinstaller
에 -d
플래그를 사용
Traceback (most recent call last):
File "", line 78, in
File "path\to\my\program\ build\pyi.win32\GDP\outPYZ1.pyz/Tkinter", line 1564, in wm_iconbitmap
_tkinter.TclError: bitmap "icon.ico' not defined
RC: -1 from main
편집 : "긴급한"질문 제목에 환영하지 않습니다. 우리 모두는 바쁜 삶을 살고 있습니다. –
Soory, 네 말이 맞아! – user12345