CSV File Not Supported Error
I think the file encoding is the problem.
The blender python assumes 'UTF-8' and maybe the command line gets the encoding from the system.

Try to give the open method a encoding:

file = open(csv_path, encoding='latin-1')


I think 'latin-1' is correct for Mac, otherwise try 'iso-8859-1' or 'cp1252'.