Collectives™ on Stack Overflow

Find centralized, trusted content and collaborate around the technologies you use most.

Learn more about Collectives

Teams

Q&A for work

Connect and share knowledge within a single location that is structured and easy to search.

Learn more about Teams

I just finished a project and want to convert it to a executable. When using pyinstaller with the command pyinstaller --onefile Music_sorter_by_Fabrice_Schöneberger.py it compiles without an error. But when executing the file I get the following:

  File "Music_sorter_by_Fabrice_Schöneberger.py", line 1, in <module>
  File "<frozen importlib._bootstrap>", line 1007, in _find_and_load
  File "<frozen importlib._bootstrap>", line 986, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 680, in _load_unlocked
  File "PyInstaller\loader\pyimod02_importers.py", line 352, in exec_module
  File "librosa\__init__.py", line 215, in <module>
  File "lazy_loader\__init__.py", line 243, in attach_stub
ValueError: Cannot load imports from non-existent stub 'C:\\Users\\fabri\\AppData\\Local\\Temp\\_MEI157482\\librosa\\__init__.pyci'
[1588] Failed to execute script 'Music_sorter_by_Fabrice_Sch÷neberger' due to unhandled exception!

The folders ...\_MEI157482\\librosa\\__init__.pyci don't exist (the before does) and if I look within the librosa installation I can't find a file named __init__.pyci. I have a __init__.pyi and __init__.py. I don't find such a file online so I hope someone here can help me.

Edit: The problem is not pyinstaller specific. py2exe has the exact same problem, that I can't find a __init___.pyci. I think i might be that the installers can't complile librosa correctly?

@MarceloPaco I've tried using --hidden-import=librosa but that didn't do anything I've also tried --collect-all librosa and the extra hook thing from this post's answere by belferink1996: stackoverflow.com/questions/63218655/… Nothing worked – Fabrice Schöneberger Mar 7 at 20:16 Good tip but also no. I tried what the comment described but I get another error SyntaxError: (unicode error) 'unicodeescape' codec can't decode bytes in position 2-3: truncated \UXXXXXXXX escape with pointing to the comma in datas. – Fabrice Schöneberger Mar 8 at 2:40

Thanks for contributing an answer to Stack Overflow!

  • Please be sure to answer the question. Provide details and share your research!

But avoid

  • Asking for help, clarification, or responding to other answers.
  • Making statements based on opinion; back them up with references or personal experience.

To learn more, see our tips on writing great answers.