Forums

Getting error "no module named emoji"

When I go to run my Flask app through pythonanywhere, I keep getting the error "no module named emoji". At the top of my app, I do have "import emoji", and the app runs with no errors on my local machine. For some reason, this is the only module giving me problems. If I remove the emoji module from the code, everything runs fine. Any idea why this would be? I've been using Python 3.6 and Flask 0.12.

Thanks!

For your python installation on your local machine, is it under python 2, not python 3? Python 3 changed the format of how files are imported (sometime to do with relative imports). Can you double check your python on your local machine? If you ran your python file from your local machine using this exact command (and similar file) python run.py, try typing python and see what version the interpreter is. If it is python 2, then change your flask webapp to python 2. Otherwise, it may be a different issue.