question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Error when building standalone with Nuitka-Python

See original GitHub issue
  • How did you install Nuitka and Python

    Did you use pip, anaconda, deb, rpm, from source, git clone, then install into a virtualenv or not, this is very important usually.

Run from source using Nuitka Python.

  • Provide in your issue the Nuitka options used

    Ideally use the project feature, so options and example code go alone

    Nuitka Options in the code

test.py: print("Hello World")

-m nuitka --standalone test.py

Error:

Traceback (most recent call last):
  File "C:\Nuitka-Python\output\lib\site-packages\nuitka\__main__.py", line 137, in <module>
    main()
  File "C:\Nuitka-Python\output\lib\site-packages\nuitka\__main__.py", line 123, in main
    MainControl.main()
  File "C:\Nuitka-Python\output\lib\site-packages\nuitka\MainControl.py", line 929, in main
    result, options = compileTree()
  File "C:\Nuitka-Python\output\lib\site-packages\nuitka\MainControl.py", line 852, in compileTree
    result, options = runSconsBackend(quiet=not Options.isShowScons())
  File "C:\Nuitka-Python\output\lib\site-packages\nuitka\MainControl.py", line 690, in runSconsBackend
    SconsInterface.runScons(
  File "C:\Nuitka-Python\output\lib\site-packages\nuitka\build\SconsInterface.py", line 249, in runScons
    options["result_name"] = getExternalUsePath(
  File "C:\Nuitka-Python\output\lib\site-packages\nuitka\utils\FileOperations.py", line 759, in getExternalUsePath
    dirname = getWindowsShortPathName(os.path.dirname(filename))
  File "C:\Nuitka-Python\output\lib\site-packages\nuitka\utils\FileOperations.py", line 728, in getWindowsShortPathName
    raise WindowsError(
FileNotFoundError: [Errno 2] The system cannot find the file specified.

git bisect led me to the following commit:

053c207229292b7f011937964a69cdf271d47532 is the first bad commit
commit 053c207229292b7f011937964a69cdf271d47532
Author: Kay Hayen <kay.hayen@gmail.com>
Date:   Mon Feb 7 09:57:30 2022 +0100

    macOS: Added support for mixing --onefile and --macos-create-app-bundle

    * For some software, e.g. PySide2 it will actually be the only way
      to get it working.

Issue Analytics

  • State:closed
  • Created a year ago
  • Comments:6 (6 by maintainers)

github_iconTop GitHub Comments

1reaction
kayhayencommented, Apr 4, 2022

I am adding a resetDirectory that first removes a directory and then creates it again, for use in these cases, that should solve the issue.

0reactions
kayhayencommented, May 20, 2022

Part of 0.8 release that I just made.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Nuitka compilation error when building on windows
I have a python project I'd like to package up as a standalone executable. I have tried PyInstaller but with little luck. So...
Read more >
User Manual - Nuitka
No information is available for this page.
Read more >
Ubuntu Manpage: nuitka - the Python compiler
--standalone, --portable Enable standalone mode in build. ... Executing all self checks possible to find errors in Nuitka, do not use for production....
Read more >
Nuitka · PyPI
Nuitka translates the Python modules into a C level program that then uses ... To distribute, build with --standalone option, which will not...
Read more >
Nuitka: Compiling Python for redistribution - YouTube
Python has no native mechanism for bundling apps for redistribution, so various third-party projects have filled the gap. The Nuitka project ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found