How can I correctly create a C++ vector in Python3 by swig?

The problem here is how you're importing and using the module you've built.

When you ran SWIG as well as generating some C++ code it also generated some Python too. Rather than directly access the native module you want to access it via the generated python instead, e.g.

import swig_test # Note no leading _
v = swig_test.MyVector([1,2,3])

Which will work just fine then.

Note that you can also ask SWIG to generate native-only module by invoking SWIG with the -builtin flag as well, e.g.:

swig -python -py3 -c++ -builtin swig_test.i

However I wouldn't usually recommend this when getting started as it makes a bunch of common things quite a lot harder.