You cannot put spaces around the = sign when you do:
export foo=bar
Remove the spaces you have and you should be good to go.
If you type:
export foo = bar
the shell will interpret that as a request to export three names: foo, = and bar. = isn’t a valid variable name, so the command fails. The variable name, equals sign and it’s value must not be separated by spaces for them to be processed as a simultaneous assignment and export.