Ned Deily added the comment:
That's because there is also a standard library module named token
(https://docs.python.org/3/library/token.html). When you run python, by
default the current working directory is inserted at the beginning of sys.path,
the list of directories searched for modules.
New submission from Peter Inglesby:
A script called token.py that imports anything that ends up importing tokenize,
such as logging, triggers the following error when the script is run:
$ cat token.py
import tokenize
$ python3 token.py
Traceback (most recent call last):
File "token.py", line