Object type <class 'str'> cannot be passed to C code - virtual environment
In Python 3, encode it into a bytearray
:
obj = AES.new('This is a key123'.encode("utf8"), AES.MODE_CBC, 'This is an IV456'.encode("utf8"))
If you store these in variables and want to use them as (Python) strings again, just use:
key_as_bytearray.decode("utf8")
Check out this answer for further information.