Your program is running using Pybricks MicroPython, not Python 3. You can tell by the shebang that is the first line of the .py file.
ev3dev has 4 different Python runtimes installed by default.
Python 2:
#!/usr/bin/env python2
Python 3:
#!/usr/bin/env python3
MicroPython
#!/usr/bin/env micropython
Pybricks MicroPython
#!/usr/bin/env pybricks-micropython
And each of these 4 has a different place where modules are stored. And there are usually small incompatibilities, so libraries for one runtime can't run on another runtime without some changes.
So it isn't going to be possible to use a Python 3 module like six in Pybricks MicroPython (or regular MicroPython).
If you need features from both Python 3 and Pybricks MicroPython, you can make two different programs that communicate with each other. Or you could try to find a way to do everything you need with a single runtime.
main.pyas well as the full command you used to start the Python REPL.