bastibe / transplant

Transplant is an easy way of calling Matlab from Python
https://transplant.readthedocs.io
Other
108 stars 26 forks source link

cannot find libzmq on windows 10 #86

Closed hardmstar closed 4 years ago

hardmstar commented 4 years ago

Hi, this module helps me a lot on liunx, but when I switch platform to windows 10, function Matlab._locate_libzmq() in transplant_master.py didn't work, raise RuntimeError('could not locate libzmq for Matlab').

I find things went wrong in row 695 search_dirs = ((os.getenv('PATH') or '').split(':') + in transplant_master.py. PATH variable should be like "C:\Program Files (x86);C:\python", but when choose ':' as the split parameter, PATH values will be split into ['C', '\\Program Files (x86);C', '\\python'], thus it cannot find *zmq*.dll from PATH variable.

        # row 693-697 in transplant_master.py
        elif sys.platform == 'win32' or sys.platform == 'cygwin':
            # according to https://msdn.microsoft.com/en-us/library/windows/desktop/ms682586(v=vs.85).aspx
            search_dirs = ((os.getenv('PATH') or '').split(':') +
                           ['C:/Program Files/ZeroMQ*/bin'])
            extension = '.dll'

Then I change .split(':') to .split(';'), and the libzmq can be find, the module works.

So could you please tell me why use ':' as the split parameter but not ';'?

bastibe commented 4 years ago

Probably a typo. Thank you for finding it! Would you like to contribute the fix as a pull request?

bastibe commented 4 years ago

Great! Linux and darwin do use : as a path separator. That's probably where I got the typo from. I wonder why that didn't break my test suite. Perhaps I had the DLL in the very first entry or something like that.

hardmstar commented 4 years ago

Agree with you. This is a brilliant work!