Does not work with Nuitka
See original GitHub issueNuitka creates a single executable out of your python code.
I’ve used platformdirs in a project of mine called mcrpc. The code itself runs fine, but the executable created with Nuitka spits out this error:
λ ./mcrpc-linux
Traceback (most recent call last):
File "/tmp/.mount_mcrpc-h4h3HH/mcrpc.py", line 14, in <module>
File "/tmp/.mount_mcrpc-h4h3HH/platformdirs/__init__.py", line 33, in <module platformdirs>
File "/tmp/.mount_mcrpc-h4h3HH/platformdirs/__init__.py", line 29, in _set_platform_dir_class
File "importlib.py", line 127, in import_module
ModuleNotFoundError: No module named 'platformdirs.unix'
It spits out a similar error on windows:
ModuleNotFoundError: No module named 'platformdirs.windows'
Is there anything that can be done on platformdirs’ side to help it work well with Nuitka? You can try using the executables from v1.2.
Issue Analytics
- State:
- Created 2 years ago
- Comments:11 (7 by maintainers)
Top Results From Across the Web
Issues · Nuitka/Nuitka - GitHub
Nuitka is a Python compiler written in Python. It's fully compatible with Python 2.6, 2.7, 3.3, 3.4, 3.5, 3.6, 3.7, 3.8, 3.9, and...
Read more >Nuitka not compiling an exe with nuitka --recurse-all hello.py ...
I am trying to create a simple exe through nuitka so that I can run it on my laptop without Python needing to...
Read more >Nuitka - Wikipedia
Nuitka is a source-to-source compiler which compiles Python code to C source code, applying some compile-time optimizations in the process such as constant ......
Read more >Ubuntu Manpage: nuitka - the Python compiler
This means not a folder, but a compressed executable is created and used. ... Otherwise Nuitka can use what you run Nuitka with...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
The issue is the dynamic imports https://github.com/platformdirs/platformdirs/blob/2.4.1/src/platformdirs/__init__.py#L20-L33
Changing to actual import statements and executing the logic outside of that function should fix it.
@gaborbernat GLORIOUS!