ImportError: No module named myapp.hooks

Hello,

When I try to launch my app in production appears: Internal Error. looking in logs, I found these:

ImportError: No module named myapp.hooks

But I have myapp into apps folder, and inside they are: myapp, build, dist, folders…
inside myapp folder, I have hooks.py

How can I fix that?

Did you install the app in your site?

Try doing

bench frappe --python and import myapp.hooks

I supposed that you created your app in a development environment and you simply copy and paste your application to the app folder.
If that is the case, this is what you have to do. You must install your app by PIP(Python Package Index)
Do this

cd frappe-bench
./env/bin/pip install -q  -e ./apps/myapp
 

And finally add myapp in sites/app.txt

1 Like

this helped me