Skip to content

How to import custom python files in app.py #1124

Answered by freakboy3742
proneon267 asked this question in Q&A
Discussion options

You must be logged in to vote

You haven't got any __init__.py files on the asset/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 is src/myapp/app.py or src/app.py. If it's the former (which would be the default structure generated by briefcase new, the import path for MyPyFile.py will be myapp.assets.MyProgram, not assets.MyProgram.

Replies: 1 comment 5 replies

Comment options

You must be logged in to vote
5 replies
@proneon267
Comment options

@freakboy3742
Comment options

@proneon267
Comment options

@freakboy3742
Comment options

@proneon267
Comment options

Answer selected by proneon267
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants