Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

FBS ModuleNotFoundError: No module named 'import_sainpli' #301

Open
NicolasTrM opened this issue Jun 6, 2024 · 0 comments
Open

FBS ModuleNotFoundError: No module named 'import_sainpli' #301

NicolasTrM opened this issue Jun 6, 2024 · 0 comments

Comments

@NicolasTrM
Copy link

NicolasTrM commented Jun 6, 2024

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 ?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant