Forums

Import Error

[formatted by admin]

2021-08-10 15:47:12,294:   File "/home/mcad/mysite/app.py", line 2, in <module>
    2021-08-10 15:47:12,294:     from pyhtml import *

Getting this error when I try to deploy my project. Whenever I try install it from requirements.txt file it perfectly installs. Project also works locally so I'm not sure what it happening? Any help appreciated.

Make sure you've installed the module for the same Python environment that your web app is using. Also, we have a help page on debugging that issue: https://help.pythonanywhere.com/pages/DebuggingImportError/.

Currently running python 3.7.9 locally with PyHTML 1.3.1 installed. On this site I have installed PyHTML 1.3.1 and am running on python 3.7

I have done the same but it does not work.

Update Solved: pip3.7 install -r requirements.txt --user

Used the above command and it installed correctly into the right version!

That's it! Thanks for confirming that.