Persistent mt5.initialize() IPC Timeout (-10005) on MT5 Build 6231 with Python 3.13 (64-bit)

 

Hello,

I am developing a Python-based trading system using the official MetaTrader 5 Python package. I am experiencing a persistent IPC timeout when attempting to connect Python to the MT5 desktop terminal.

Environment

  • OS: Windows 64-bit

  • Python: 3.13.15 (64-bit)

  • MetaTrader5 Python package: 5.0.6231

  • MT5 terminal: Build 6231

  • Broker: Exness demo account

  • Terminal executable: C:\Program Files\MetaTrader 5\terminal64.exe

Error

mt5.initialize(path=r"C:\Program Files\MetaTrader 5\terminal64.exe") False mt5.last_error() (-10005, 'IPC timeout')

Troubleshooting already performed

  1. Confirmed Python and the MT5 terminal are 64-bit.

  2. Verified that the MetaTrader5 Python package imports successfully.

  3. Confirmed the terminal is running and logged into my Exness demo account.

  4. Checked MT5's Expert Advisors settings. “Disable algorithmic trading via external Python API” is unchecked.

  5. Specified the exact terminal executable path in mt5.initialize() .

  6. Increased the initialization timeout to 120,000 ms. The call still failed with (-10005, 'IPC timeout') .

  7. Tested an isolated portable terminal in a separate directory. It also failed with the same error.

  8. Verified that the terminal process was running and listening on its local IPC-related port.

  9. Reinstalled neither MT5 nor the Python package, and have not modified the existing installation.

No orders were placed, and no live account was used for these tests.

Questions

  1. Is there a known Python IPC compatibility issue with MT5 Build 6231 and Python 3.13?

  2. Are there known issues with MetaTrader5 Python package version 5.0.6231?

  3. Is there an official, supported method to test an earlier MT5 terminal build side by side without modifying the current installation?

  4. Are there additional diagnostic steps or logs that can identify why the IPC handshake is timing out?

I would appreciate any technical guidance or confirmation of a known issue. I am happy to provide further diagnostic information if needed.

Thank you.

 

A common cause of -10005 is an elevation mismatch. If terminal64.exe runs as administrator and Python doesn't (or the other way round), the IPC handshake just times out even though the terminal looks fine. Run both at the same level, close all terminal instances, and let Python start the terminal itself:

import MetaTrader5 as mt5
ok = mt5.initialize(path=r"C:\Program Files\MetaTrader 5\terminal64.exe")
print(ok, mt5.last_error())

If it still times out with nothing else running, then it's worth reporting with the build numbers to Service Desk.

 
Navid Mirzaaghazadeh #:

A common cause of -10005 is an elevation mismatch. If terminal64.exe runs as administrator and Python doesn't (or the other way round), the IPC handshake just times out even though the terminal looks fine. Run both at the same level, close all terminal instances, and let Python start the terminal itself:

Nice assumption without any evidence.

If it still times out with nothing else running, then it's worth reporting with the build numbers to Service Desk.

Whatever, technical issue should NOT be reported to the ServiceDesk, only financial issue. Please avoid such advice on the forum.

 
67193433:

Hello,

I am developing a Python-based trading system using the official MetaTrader 5 Python package. I am experiencing a persistent IPC timeout when attempting to connect Python to the MT5 desktop terminal.

Environment

  • OS: Windows 64-bit

  • Python: 3.13.15 (64-bit)

  • MetaTrader5 Python package: 5.0.6231

  • MT5 terminal: Build 6231

  • Broker: Exness demo account

  • Terminal executable: C:\Program Files\MetaTrader 5\terminal64.exe

Error

mt5.initialize(path=r"C:\Program Files\MetaTrader 5\terminal64.exe") False mt5.last_error() (-10005, 'IPC timeout')

Troubleshooting already performed

  1. Confirmed Python and the MT5 terminal are 64-bit.

  2. Verified that the MetaTrader5 Python package imports successfully.

  3. Confirmed the terminal is running and logged into my Exness demo account.

  4. Checked MT5's Expert Advisors settings. “Disable algorithmic trading via external Python API” is unchecked.

  5. Specified the exact terminal executable path in mt5.initialize() .

  6. Increased the initialization timeout to 120,000 ms. The call still failed with (-10005, 'IPC timeout') .

  7. Tested an isolated portable terminal in a separate directory. It also failed with the same error.

  8. Verified that the terminal process was running and listening on its local IPC-related port.

  9. Reinstalled neither MT5 nor the Python package, and have not modified the existing installation.

No orders were placed, and no live account was used for these tests.

Questions

  1. Is there a known Python IPC compatibility issue with MT5 Build 6231 and Python 3.13?

  2. Are there known issues with MetaTrader5 Python package version 5.0.6231?

  3. Is there an official, supported method to test an earlier MT5 terminal build side by side without modifying the current installation?

  4. Are there additional diagnostic steps or logs that can identify why the IPC handshake is timing out?

I would appreciate any technical guidance or confirmation of a known issue. I am happy to provide further diagnostic information if needed.

Thank you.

Before asking all these questions, you should firstly report your issue correctly.

What python code are you running ? Do you run it through MT5/ME or from a command line or otherwise ? In the latter case, is MT5 already open or is it python who launch it ?