I’ve created a small program that uses a UI – I used auto-py-to-exe with one-file to convert main.py and its retrospective modules into an exe file. However, when trying to launch the EXE I get an error. This is my first time creating an exe from a python file, so I’m most likely doing something wrong.
Traceback (most recent call last):
File "main.py", line 8, in <module>
File "<frozen importlib._bootstrap>", line 1360, in _find_and_load
File "<frozen importlib._bootstrap>", line 1331, in _find_and_load_unlocked
File "<frozen importlib._bootstrap>", line 935, in _load_unlocked
File "PyInstallerloaderpyimod02_importers.py", line 378, in exec_module
File "configassets.py", line 47, in <module>
File "configassets.py", line 13, in __init__
sqlite3.OperationalError: unable to open database file
SQLITE3 Error Message
The database is accessed with this bit of code:
class getImages():
def __init__(self) -> None:
'''Creates a dictionary of dictionaries containing image data.
Attributes:
images: list of image data
'''
self.connection = sqlite3.connect("config\data.sqlite")
self.cursor = self.connection.cursor()
I’m not entirely sure what the problem could be, maybe I’m using auto-py-to-exe incorrectly?
Here’s the structure of the directory:
assets/
fonts/
inpin.ttf
config/
assets.py
data.sqlite
module.py
window.py
generator/
scroll_area.py
modules/
base/
assets.py
uploading.py
boxArt/
assets.py
init.py
magazineArt/
assets.py
init.py
posterArt/
assets.py
init.py
obj.py
sql.py
main.py
I’ve tried just adding main.py to to auto-py-to-exe, I’ve tried adding each folder using –add-data with their files and I’ve also tried adding only the sqlite file to –add-data
2