OpenTrading / OTMql4Zmq

Open Trading Metatrader 4 ZeroMQ Bridge
MIT License
99 stars 46 forks source link

OTMql4Zmq over PyZmq failure at import zmq #13

Closed oafx closed 8 years ago

oafx commented 8 years ago

Hi,

i'm pretty new to python so i'm not sure if i'm doing anything wrong but running OTPyTestZmqEA.ex4 fails with the following message: 2015.11.26 10:28:21.576 2015.06.01 00:00 OTPyTestZmqEA EURUSD,M1: PANIC: PANIC: import zmq failed:<type 'exceptions.WindowsError'> : [Error 126] Das angegebene Modul wurde nicht gefunden which basically means the module wasn't found in english.

reading the logfile it seems that there is a problem when including the file libsodium.pyd:

vPyInit - Thread Dummy-3 number 13360
Traceback (most recent call last):
  File "<string>", line 1, in <module>
  File "C:\Python27\lib\site-packages\zmq\__init__.py", line 45, in <module>
    _libsodium = ctypes.cdll.LoadLibrary(bundled_sodium[0])
  File "C:\Python27\lib\ctypes\__init__.py", line 431, in LoadLibrary
    return self._dlltype(name)
  File "C:\Python27\lib\ctypes\__init__.py", line 353, in __init__
    self._handle = _dlopen(self._name, mode)
WindowsError: [Error 126] Das angegebene Modul wurde nicht gefunden
INFO : vPyDeInit Closing outfile

i did some digging but can't come up with the reason why it can't find the module as it is where bundled_sodium[0] is pointing. Furthermore importing zmq via import zmq in the python cli does work without any problems, which makes me wonder if there is some kind of difference in how the python process is handled when created by OTMql4Py.

I'd appreciate some help. Thanks

oafx commented 8 years ago

On further investigation it seems like there is somewhere a dependency for a version of MSCVR90.dll that i don't seem to have even though having the corresponding ms redist installed.. i'm still wondering from where this error actually emerges, since i can run pyzmq via the python.exe just fine.

OpenTrading commented 8 years ago

Did you solve the problem? I'm sure python 2.7 requires MSCVR90.dll so you should have had that already if your Python was working. The catch is the libzmq.dll with OTMql4Zmq also requires MSCVR100.dll as it was compiled with MSVC 2010. Having both runtimes is not a problem. If you still have the problem, maybe use dependencywalker.com to help.

We've updated the documentation to say the MSVC 10 runtime is a prerequisite.