What to check
- Check that the Python running your script is a Windows build. Run
python -c "import sys; print(sys.platform)"in the same environment; on Windows it prints win32. On Linux or macOS, read the MetaTrader5 package on Linux and macOS. - Check that a MetaTrader 5 terminal is installed, running and logged in to your account before initialize() is called.
- If more than one terminal is installed, pass the full path of the one you mean to
initialize(path=...), so there is no doubt which copy the package connects to. - initialize() also takes a timeout argument (MQL5 docs). If the terminal is slow to start, a longer value is a fair check. Neither the thread nor the docs say it cures -10005.
- Check the terminal is build 4755 or later. MetaQuotes ended support for older terminals from 1 Jul 2025, and older terminals cannot connect to broker servers.
The fix reported in the thread is the Windows Python point in step 1. Steps 2 to 5 are checks we suggest, not fixes anyone has reported for this error.
Next steps for this error
- Every MetaTrader 5 endpoint No single endpoint is named for this error on this site.
- MetaTrader 5 quickstart
Why it happens
The MetaTrader5 package does not talk to your broker. It talks to a MetaTrader 5 terminal running on the same machine, over interprocess communication, and the terminal talks to the broker's server. When initialize() cannot complete that local handshake in time, last_error() returns -10005.
In the MQL5 forum thread of 22 Jan 2025, the reply to this error was that on Linux and macOS the package needs Windows Python. PyPI agrees on the packaging side: the newest release when we read it, 5.0.6231 of 27 Sep 2026, ships wheels for win32 and win_amd64 only, with no macOS or Linux build.
Questions
What does error code -10005 mean in MetaTrader5 Python?
It is RES_E_INTERNAL_FAIL_TIMEOUT, which MQL5's last_error table describes as an internal timeout: the package waited for the MetaTrader 5 terminal and got no answer in time.
Is the IPC timeout a problem with my broker?
Not on its own. The package reaches the terminal on your machine by interprocess communication, and only the terminal talks to the broker, so check the terminal and your Python first.
How do I fix (-10005, 'IPC timeout') on Linux or macOS?
The reply in the MQL5 forum thread of 22 Jan 2025 is that on Linux and macOS the package needs Windows Python. PyPI publishes the package for win32 and win_amd64 (Windows) only.
Will a longer timeout in initialize() fix it?
Nobody in the sources we read reports that. initialize() does take a timeout argument, so a longer value is a fair check if the terminal is slow to start, but treat it as a test, not a known fix.
Sources
- MQL5 forum: issue regarding python integration with metaTrader5posted 22 Jan 2025, checked 21 Sep 2026
- MQL5 docs: last_errorchecked 19 Sep 2026
- MQL5 docs: initializechecked 20 Sep 2026
- MQL5 docs: MetaTrader for Pythonchecked 20 Sep 2026
- PyPI: MetaTrader5checked 21 Sep 2026
- MetaQuotes company news: end of support for older terminalschecked 20 Sep 2026