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.

Unable to complete onefile creation

See original GitHub issue

Hi all,

Following Kay Hayen’s advice on Gitter, here’s a full report of the issue I found.

  • Nuitka version:
Python: 3.9.2 (default, Feb 28 2021, 17:03:44)
Executable: /usr/bin/python3
OS: Linux (Windows WSL/Debian)
Arch: x86_64
  • How did you install Nuitka and Python: Python was downloaded from the original site, Nuitka was installed using sudo apt-get -y install nuitka. Additional installation includes sudo apt-get -y install clang.

  • The specific PyPI names and versions:

beautifulsoup4==4.9.3
chardet==4.0.0
click==8.1.3
dlib==19.24.0
face-recognition==1.3.0
face-recognition-models==0.3.0
html5lib==1.1
imageio==2.19.3
joblib==1.1.0
lxml==4.6.3
natsort==8.1.0
networkx==2.8.4
Nuitka==0.6.11.3
numpy==1.22.4
packaging==21.3
pbr==5.9.0
Pillow==9.1.1
Pygments==2.7.1
pyparsing==3.0.9
PyWavelets==1.3.0
PyYAML==5.3.1
scikit-image==0.19.3
scikit-learn==1.1.1
scipy==1.8.1
SCons==4.0.1
six==1.16.0
soupsieve==2.2.1
testresources==2.0.1
threadpoolctl==3.1.0
tifffile==2022.5.4
torch==1.7.1+cpu
typing_extensions==4.2.0
webencodings==0.5.1
  • Compiling hello.py also fails:
Nuitka:INFO: Starting Python compilation.
Nuitka:INFO: Completed Python level compilation and optimization.
Nuitka:INFO: Generating source code for C backend compiler.
Nuitka:INFO: Running data composer tool for optimal constant value handling.
Nuitka:INFO: Running C level backend compilation via Scons.
Nuitka-Scons:INFO: Backend C compiler: gcc (gcc).
Nuitka-Scons:INFO: Compiled 12 C files using ccache.
Nuitka-Scons:INFO: Cached C files (using ccache) with result 'disabled': 1
Nuitka-Scons:INFO: Cached C files (using ccache) with result 'cache hit': 9
Nuitka-Scons:INFO: Cached C files (using ccache) with result 'cache miss': 2
Nuitka-Postprocessing:INFO: Creating single file from dist folder, this may take a while.
FATAL: Error, expected output file hello.bin not created by AppImage.
import cv2
import numpy as np
import torch
import os
import time
import skimage

import configparser

#------------------------------------------------------
#                     Read parameters
# Set this depending on your camera type:
# - True = Raspberry Pi 2.x camera module
# - False = USB webcam or other USB video input (like an HDMI capture device)
#------------------------------------------------------
config = configparser.ConfigParser()
config.read(initFilename)

USING_RPI_CAMERA_MODULE = (config.get("init", "CAMERA_INPUT") == "RPI")
FLIP_IMAGE_MODE = int(config.get("init", "FLIP_IMAGE_MODE"))
MEASURE_TIME = (config.get("init", "MEASURE_TIME") == "True")
SIMILARITY_THRESHOLD = float(config.et("crypto", "SIMILARITY_THRESHOLD"))

##################### Training Parametres #############
OUTPUT_PATH = config.get("init", "OUTPUT_PATH")
device = torch.device("cuda" if torch.cuda.is_available() else "cpu")

IMAGE_SIZE = int(config.get("crypto", "IMAGE_SIZE"))
CRYPTO_BLOCK_SIZE = int(config.get("crypto", "CRYPTO_BLOCK_SIZE"))
USE_CRYPTO_RANDOM_IMAGE = (config.get("crypto", "USE_CRYPTO_RANDOM_IMAGE") == "True")
MAX_GRAYSCALE = float(config.get("crypto", "MAX_GRAYSCALE"))

BACKBONE_WEIGHT_NAME = OUTPUT_PATH + "/" + config.get("results", "BACKBONE_WEIGHT_NAME")
REFERENCE_NAME = OUTPUT_PATH + "/" + config.get("crypto", "REFERENCE_NAME")

####################  Encryption parameters ###########
BLOCK_ORDER_REFERENCE = OUTPUT_PATH + "/" + config.get("crypto", "BLOCK_ORDER_REFERENCE")
with open(BLOCK_ORDER_REFERENCE, 'rb') as f:
    shuffle_block_order = np.load(f)
LIST_BLOCK_REFERENCE = OUTPUT_PATH + "/" + config.get("crypto", "LIST_BLOCK_REFERENCE")
with open(LIST_BLOCK_REFERENCE, 'rb') as f:
    list_block_keys = np.load(f)
CLASS_NAME_REFERENCE = OUTPUT_PATH + "/" + config.get("crypto", "CLASS_NAME_REFERENCE")
with open(CLASS_NAME_REFERENCE, 'rb') as f:
    class_names = np.load(f)
LABEL_REFERENCE = OUTPUT_PATH + "/" + config.get("crypto", "LABEL_REFERENCE")
with open(LABEL_REFERENCE, 'rb') as f:
    labelSet = np.load(f)

referenceSet = torch.load(REFERENCE_NAME).to(device)

##########################################################
##################### Network's configuration ############
print("Loading model...")

def main_loop():

    print("Begin testing...")

    while True:

        if MEASURE_TIME:
            start_time =  time.time()

        # Hit 'q' on the keyboard to quit!
        if cv2.waitKey(1) & 0xFF == ord('q'):
            break

    # Release handle to the webcam
    cv2.destroyAllWindows()

if __name__ == "__main__":
    main_loop()

  • Provide in your issue the Nuitka options used: python3 -m nuitka --onefile --python-flag=no_site --prefer-source-code --plugin-enable=numpy --plugin-enable=torch --linux-onefile-icon=ARCLAN1.ico ssce.py

  • Note if this is a regression: n/a

Here’s the output when compiling real code:

 python3 -m nuitka --onefile --python-flag=no_site --prefer-source-code --plugin-enable=numpy --plugin-enable=torch --linux-onefile-icon=test.ico testapp.py
Nuitka:INFO: Starting Python compilation.
Nuitka:INFO: Completed Python level compilation and optimization.
Nuitka:INFO: Generating source code for C backend compiler.
Nuitka:INFO: Running data composer tool for optimal constant value handling.
Nuitka:INFO: Running C level backend compilation via Scons.
Nuitka-Scons:INFO: Backend C compiler: gcc (gcc).
Nuitka-Scons:INFO: Slow C compilation detected, used 60s so far, this might indicate scalability problems.
Nuitka-Scons:INFO: Running /usr/bin/ccache /usr/bin/gcc -o module.scipy.stats._continuous_distns.o -c -std=c11 -fvisibility=hidden -fwrapv -fpartial-inlining -ftrack-macro-expansion=0 -Wno-deprecated-declarations -fno-var-tracking -fcompare-debug-second -O3 -pipe -D_NUITKA_STANDALONE -D__NUITKA_NO_ASSERT__ -D_NUITKA_CONSTANTS_FROM_INCBIN -D_NUITKA_FROZEN=164 -D_NUITKA_EXE -I/usr/include/python3.9 -I. -I/usr/lib/python3/dist-packages/nuitka/build/include -I/usr/lib/python3/dist-packages/nuitka/build/static_src module.scipy.stats._continuous_distns.c took 96.71 seconds
Nuitka-Scons:INFO: Slow C compilation detected, used 60s so far, this might indicate scalability problems.
Nuitka-Scons:INFO: Running /usr/bin/ccache /usr/bin/gcc -o module.tifffile.tifffile.o -c -std=c11 -fvisibility=hidden -fwrapv -fpartial-inlining -ftrack-macro-expansion=0 -Wno-deprecated-declarations -fno-var-tracking -fcompare-debug-second -O3 -pipe -D_NUITKA_STANDALONE -D__NUITKA_NO_ASSERT__ -D_NUITKA_CONSTANTS_FROM_INCBIN -D_NUITKA_FROZEN=164 -D_NUITKA_EXE -I/usr/include/python3.9 -I. -I/usr/lib/python3/dist-packages/nuitka/build/include -I/usr/lib/python3/dist-packages/nuitka/build/static_src module.tifffile.tifffile.c took 193.58 seconds
Nuitka-Scons:INFO: Compiled 1030 C files using ccache.
Nuitka-Scons:INFO: Cached C files (using ccache) with result 'disabled': 1
Nuitka-Scons:INFO: Cached C files (using ccache) with result 'cache hit': 389
Nuitka-Scons:INFO: Cached C files (using ccache) with result 'cache miss': 640
Nuitka-Plugins:INFO: torch: Copying files from 'torch' installation:
Nuitka-Plugins:INFO: torch: Copied 1436 files.
Nuitka-Postprocessing:INFO: Creating single file from dist folder, this may take a while.
Nuitka-Postprocessing:INFO: Completed onefile creation.
Traceback (most recent call last):
  File "/usr/lib/python3/dist-packages/nuitka/__main__.py", line 209, in <module>
    main()
  File "/usr/lib/python3/dist-packages/nuitka/__main__.py", line 195, in main
    MainControl.main()
  File "/usr/lib/python3/dist-packages/nuitka/MainControl.py", line 773, in main
    packDistFolderToOnefile(dist_dir, binary_filename)
  File "/usr/lib/python3/dist-packages/nuitka/freezer/Onefile.py", line 51, in packDistFolderToOnefile
    packDistFolderToOnefileLinux(onefile_output_filename, dist_dir, binary_filename)
  File "/usr/lib/python3/dist-packages/nuitka/freezer/Onefile.py", line 161, in packDistFolderToOnefileLinux
    assert result == 0, result
AssertionError: 1

Thanks in advance for any help!

Issue Analytics

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

github_iconTop GitHub Comments

1reaction
jlgarniercommented, Jun 23, 2022

Hi again,

I managed to update the package but the compilation now stumbles on modprobe: FATAL: Module fuse not found in directory /lib/modules/4.4.0-19041-Microsoft, while the whole process stops after downloading appimagetools with FATAL: Error, error exit from AppImage because fuse kernel module was not loaded: I’m afraid fuse cannot properly install in a WSL container.

Any feedback on this?

0reactions
kayhayencommented, Jul 5, 2022

On develop right now, the --onefile-tempdir behavior is the default, ought to use that, it doesn’t use fuse to build anymore.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Unable to complete onefile creation - PullAnswer
You can try --onefile-tempdir to avoid that code, but best course of action will the to update. The code doesn't match current Nuitka...
Read more >
Pyinstaller:unable to create onefile .exe which has .png file
I was creating a tkinter program which I need to make into exe so I can ... At first it was running without...
Read more >
[Errno 13] Permission denied --onefile FileIO Issue #6467
I suppose that file does not get closed completely before the append process starts. I would make a pull request about this problem,...
Read more >
Problems with Pyinstaller & and Common Fixes - YouTube
This Video was created for the purpose of addre... ... Your browser can't play this video. Learn more. Switch camera.
Read more >
Creating and publishing custom data forms - OneFile : Support
Once a Form has been created, it gets published into a particular area, which determines where the new fields appear and who can...
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