Persistent Python API IPC Timeout (-10005) – MT5 Build 6317 and Python 3.12.10
Additional diagnostic results:
I confirmed that the running MT5 process uses C:\MT5-Python-Test\terminal64.exe /portable, with the correct Exness demo account manually authenticated.
I also tested Python package versions 5.0.6180 and 5.0.6231, including initialization with the explicit account number, server, and portable=True.
All tests continue to return (-10005, 'IPC timeout').
Python successfully launches the terminal, but the IPC connection fails. No relevant blocks were found in Sophos security events.
Could MetaQuotes advise whether this is a known compatibility issue with MT5 Build 6317 or recommend additional IPC diagnostics?
When Python can start the terminal but never gets the IPC link, the cause is usually permissions between the two processes, not the package version. Things I would try in this order:
1. Run Python and the terminal at the same privilege level. If MT5 runs as administrator and Python does not (or the other way round), the pipe is created but the other side cannot open it. Run both normally, no admin.
2. Close every MT5 window, then let initialize(path=...) start the terminal itself and wait until the account is fully logged in before the first call.
3. Check Tools > Options > Expert Advisors > Allow algorithmic trading in that portable copy, each portable folder has its own settings.
4. Even with no events in the log, add an antivirus exclusion for the whole C:\MT5-Python-Test folder and for python.exe. Endpoint tools often block named pipes silently.
5. As a control test, install a normal copy in Program Files without /portable and connect without the path argument. If that one works, the problem is the portable folder and not build 6317.
Hello MQL5 Community,
I would appreciate assistance with a persistent IPC timeout when connecting Python to MetaTrader 5 through the official MetaTrader5 Python package.
1. System environment
Operating System: Windows 11 64-bit
Python: 3.12.10 (64-bit)
MT5 Terminal: Build 6317
Broker: Exness
Account type: Demo
Server: Exness-MT5Trial14
Python package versions tested: 5.0.6231 and 5.0.6180
2. Error encountered
Every initialization attempt returns:
Connect: False Error: (-10005, 'IPC timeout') Terminal: None Account: None
3. Troubleshooting performed
Verified Python and MT5 are both 64-bit.
Confirmed successful installation and import of the MetaTrader5 package.
Tested initialization using the explicit terminal executable path.
Tested 10-second and 60-second timeouts.
Tested using explicit account and server parameters.
Created a separate portable MT5 installation at C:\MT5-Python-Test.
Tested using portable=True.
Tested package versions 5.0.6231 and 5.0.6180 in an isolated virtual environment.
Confirmed "Disable algorithmic trading via external Python API" is unchecked.
Confirmed "Python integration" under Tools → Options → Community is enabled.
Confirmed only one terminal64.exe process was running during testing.
Confirmed MT5 starts successfully and logs into the Exness demo account.
4. Additional diagnostic results
The MT5 Journal displays:
MCP started on 127.0.0.1:22346
Windows confirms that the port is listening, and the process belongs to terminal64.exe.
Python can also establish a TCP connection to that port successfully.
However, the official MetaTrader5 Python API initialization continues to return the same IPC timeout.
5. Questions
Is there a known compatibility issue involving MT5 Build 6317 and Python package versions 5.0.6231 or 5.0.6180?
Are there additional Windows settings, permissions, or dependencies required for Python IPC communication?
Is there a diagnostic utility or log that can identify why Python cannot establish its IPC connection?
Is there a recommended workaround or known working combination of MT5 build and Python package version?
My objective is to use Python for market-data retrieval, technical analysis, and demo trading through the official MT5 Python API.
I would appreciate any technical guidance or recommendations.
Thank you.