Ask coding questions

← Back to all posts
Importing other files into repl.it?
CaptainAnon (48)

I have this code. I'm trying to import my models into a flask application, but when I do so I get an error:

Traceback (most recent call last):
  File "main.py", line 6, in <module>
    from models import User
  File "/home/runner/models.py", line 1, in <module>
    from main import db, SECURITY_LEVEL
  File "/home/runner/main.py", line 6, in <module>
    from models import User
ImportError: cannot import name 'User'