I'm currently trying to connect to v-rep in headless mode using the python remote API. It's working fine under my ubuntu laptop but it fails (most of the time...) under mac os.
could you try if the same code works when not in headless mode? What version of V-REP are you running?
Also, be aware that the path and file system is different on Mac: the V-REP application is located in a bundle (i.e. vrep.app) and you might have to specify the path out of the bundle (the executable that launches V-REP is located inside of the bundle at: vrep.app/Contents/MacOS/vrep. When you do not specify an absolute path to your file, it will search from within the bundle )