Skip to content

FBS ModuleNotFoundError: No module named 'import_sainpli' #301

@NicolasTrM

Description

@NicolasTrM

Hi,

I have error, when i run my.exe with the error "ModuleNotFoundError: No module named 'import_sainpli' (see after use fbs freeze --debug and run my.exe in terminal
import_sainpli.py is a local lib

in "src\main\python\sAINpli" i have

__ init __.py
main.py
sAINpli.py
.. other py file

fbs run is working fine

I can use "Declaring dependencies" https://build-system.fman.io/manual/#dependencies
because it's local file (no package)

in base.json i had try

{ "app_name": "sAINpli", "author": "Transpolis", "main_module": "src/main/python/sAINpli/main.py", "version": "1.0.0", "hidden_imports": ["src/main/python/sAINpli/import_sainpli.py"] }

but i have the same error

int main i have the code (to be closest of advice in "Your Python code" https://build-system.fman.io/manual/#dependencies
and to use cached_property cached_property

from fbs_runtime.application_context import cached_property
from fbs_runtime.application_context.PyQt5 import ApplicationContext
from PyQt5.QtWidgets import QMainWindow
import sys
import os
print( "################################")
print( os.getcwd() )

print( "################################")

from inspect import currentframe, getframeinfo

frame = getframeinfo(currentframe())
filename , line = frame.filename , frame.lineno
print("Filename:", filename , " Line Number:", line)

from import_sainpli import *
sys.setrecursionlimit(9999999)
from sAINpli import sAINpli

class AppContext(ApplicationContext):
@cached_property
def window(self):
return sAINpli()
@cached_property
def db(self):
return Database()
def run(self):
self.app.setStyle('Fusion')
self.window.create_window()
return self.app.exec()

if name == 'main':
appctxt = AppContext()
appctxt.run()

Any idea ?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions