Adding on to @victorosilva
's comment, the annotation import is only available on Python 3.7+. For Python 3.6 and below, the workaround to the self-referential issue is to put the class name in single quotes, as discussed here:
I also highly recommend conda environments, it is really nice to have per-project Python version and dependency specifications without messing with system Python.
Adding on to @victorosilva 's comment, the
annotation
import is only available on Python 3.7+. For Python 3.6 and below, the workaround to the self-referential issue is to put the class name in single quotes, as discussed here:Oh, I guess I'll try this approach first, since Ubuntu is on Python 3.6.8.
I also highly recommend
conda
environments, it is really nice to have per-project Python version and dependency specifications without messing with system Python.Python has venv so you can just run
python -m venv {path}
.