libratom folder does not get created

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

libratom folder does not get created

Vunkyo
Hey,

I am trying to get my GUI into an exe but it seems pyinstaller is not taking some folders that are needed. 
If i run this command:

pyinstaller Main.py

and then in powershell try to start the executable i get this:


Traceback (most recent call last):
  File "importlib\resources.py", line 97, in open_binary
FileNotFoundError: [Errno 2] No such file or directory: 'D:\\User\\Documents\\ipfit7-app\\dist\\Main\\libratom\\data\\media_types.json'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "Main.py", line 6, 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 "d:\user\documents\ipfit7-app\venv\lib\site-packages\PyInstaller\loader\pyimod03_importers.py", line 491, in exec_module
    exec(bytecode, module.__dict__)
  File "mail\mailanalyse.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 "d:\user\documents\ipfit7-app\venv\lib\site-packages\PyInstaller\loader\pyimod03_importers.py", line 491, in exec_module
    exec(bytecode, module.__dict__)
  File "mail\emails\getpst.py", line 1, 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 "d:\user\documents\ipfit7-app\venv\lib\site-packages\PyInstaller\loader\pyimod03_importers.py", line 491, in exec_module
    exec(bytecode, module.__dict__)
  File "libratom\lib\__init__.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 "d:\user\documents\ipfit7-app\venv\lib\site-packages\PyInstaller\loader\pyimod03_importers.py", line 491, in exec_module
    exec(bytecode, module.__dict__)
  File "libratom\lib\pff.py", line 16, 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 "d:\user\documents\ipfit7-app\venv\lib\site-packages\PyInstaller\loader\pyimod03_importers.py", line 491, in exec_module
    exec(bytecode, module.__dict__)
  File "libratom\data\__init__.py", line 15, in <module>
  File "contextlib.py", line 113, in __enter__
  File "importlib\resources.py", line 201, in path
  File "importlib\resources.py", line 111, in open_binary
FileNotFoundError: 'media_types.json' resource not found in 'libratom.data'
[10636] Failed to execute script Main



The librom\data folder is not in the dist\Main\ folder that gets created by pyinstaller
if i then copy this folder to the dist\Main\ folder then it works flawlessly

now you might think that that has solved my issue but the problem is that i want to use the --onefile parameter and when i do that i can't cope pase the needed folder into anywhere. 
my question is if there is a way to make it include that librom\data folder.

thnx in advance. it would help a lot!



--
You received this message because you are subscribed to the Google Groups "PyInstaller" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/pyinstaller/d3d6efd6-3bdd-4bcf-9d91-bcfca903848co%40googlegroups.com.
Reply | Threaded
Open this post in threaded view
|

Re: libratom folder does not get created

bwoodsend

Use the --add-data option to include extra files. The syntax is --add-data path/to/file;path/to/put/it. Your command should look like PyInstaller --add-data D:/path/to/libratom/data/media_types.json;libratom/data/media_types.json.

--
You received this message because you are subscribed to the Google Groups "PyInstaller" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/pyinstaller/b5e88f37-1fca-4918-9b57-92a584cceecdo%40googlegroups.com.