In 3.2.3, on Mac OS X, the `vrep.py` file from `remoteApiBindings/python/python` contains these lines:
Code: Select all
from ctypes import *
libsimx = None
try:
if platform.system() =='Windows':
libsimx = CDLL("./remoteApi.dll")
elif platform.system() == 'Darwin':
libsimx = CDLL(os.path.abspath(os.path.join(__file__, '../remoteApi.dylib'), ))
else:
libsimx = CDLL("./remoteApi.so")
except:
Code: Select all
import ctypes as ct
libsimx = None
try:
if platform.system() =='cli':
libsimx = ct.CDLL("./remoteApi.dll")
elif platform.system() =='Windows':
libsimx = ct.CDLL("./remoteApi.dll")
elif platform.system() == 'Darwin':
libsimx = ct.CDLL("./remoteApi.dylib")
else:
libsimx = ct.CDLL("./remoteApi.so")
except:
Code: Select all
import os # missing from Linux version.
import ctypes as ct # better than from ctypes import *, which is typically frown upon. (impacts many other lines in the file)
libsimx = None
try:
if platform.system() in ('cli', 'Windows'): # more compact
libsimx = ct.CDLL("./remoteApi.dll")
elif platform.system() == 'Darwin':
libsimx = ct.CDLL(os.path.abspath(os.path.join(__file__, '../remoteApi.dylib')))
else:
libsimx = ct.CDLL(os.path.abspath(os.path.join(__file__, "../remoteApi.so")))
except Exception as e:
print(e) # prints informative message, such as:
# "/home/fbenurea/.pyenv/versions/2.7.6/lib/python2.7/site-packages/remoteApi.so: cannot open shared object file: No such file or directory"
# or
# "name 'os' is not defined"
# which help diagnose the problem
Cheers,
Fabien