I just installed the server package from this project and then tried to do from server import app in a Python 3 script. This doesn't work, and results in an error:
ModuleNotFoundError: No module named 'config'
I did some googling, and here's what I came up with: implicit relative imports (eg import config in server/app.py) aren't valid in Python 3. Confusingly, they still appear to work in certain circumstances (like when you run python app.py), but that's down to the details of how sys.path is set in that specific case (tldr; they actually function as absolute important statements under these conditions).
I just installed the
server
package from this project and then tried to dofrom server import app
in a Python 3 script. This doesn't work, and results in an error:I did some googling, and here's what I came up with: implicit relative imports (eg
import config
inserver/app.py
) aren't valid in Python 3. Confusingly, they still appear to work in certain circumstances (like when you runpython app.py
), but that's down to the details of howsys.path
is set in that specific case (tldr; they actually function as absolute important statements under these conditions).