How to import custom python files in app.py
#1124
-
If I have the following structure inside and I have Normally, I could do |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 5 replies
-
You haven't got any In addition: you say you have this structure "inside your src directory" - but you don't describe whether the path to |
Beta Was this translation helpful? Give feedback.
You haven't got any
__init__.py
files on theasset/MyProgram
path, so from Python's perspective,assets
isn't on the PYTHONPATH. If you add__init__.py
files, the path will become importable.In addition: you say you have this structure "inside your src directory" - but you don't describe whether the path to
app.py
issrc/myapp/app.py
orsrc/app.py
. If it's the former (which would be the default structure generated bybriefcase new
, the import path forMyPyFile.py
will bemyapp.assets.MyProgram
, notassets.MyProgram
.