当我在另一台PC上运行exc文件时,它会出错。但在我PC上,exc文件运行顺利,但在另一台PC上,它会出错,
Traceback (most recent call last):
File "main.py", line 5, in <module>
File "<frozen importlib._bootstrap>", line 991, in _find_and_load
File "<frozen importlib._bootstrap>", line 975, in _find_and_load_unlocked
File "<frozen importlib._bootstrap>", line 671, in _load_unlocked
File "PyInstaller/loader/pyimod02_importers.py", line 391, in exec_module
File "Create_table/create_table_PT.py", line 3, in <module>
File "<frozen importlib._bootstrap>", line 991, in _find_and_load
File "<frozen importlib._bootstrap>", line 975, in _find_and_load_unlocked
File "<frozen importlib._bootstrap>", line 671, in _load_unlocked
File "PyInstaller/loader/pyimod02_importers.py", line 391, in exec_module
File "db_connection.py", line 12, in <module>
sqlite3.OperationalError: unable to open database file
[41403] Failed to execute script 'main' due to unhandled exception!
字符串
1条答案
按热度按时间dsf9zpds1#
只需尝试命令:- pyinstaller --onefile“你的python文件名”