# MT5 Python initialize() failed: error -10005, IPC timeout

Independent and unofficial. Not affiliated with or endorsed by any broker or platform named here. Educational only: nothing here is advice, and nothing here recommends a broker or a trade.

This is the markdown version of https://openbrokerapi.com/errors/mt5/ipc-timeout-10005, written from the same records as that page.

Risk warning: CFDs and spread bets are complex instruments and come with a high risk of losing money rapidly due to leverage. You can lose money on these products, and each provider publishes its own loss figure under FCA rules. You should consider whether you understand how they work and whether you can afford to take the high risk of losing your money. Automated and API trading can amplify losses through bugs, connectivity failures and runaway orders.

The MetaTrader5 Python package asked the MetaTrader 5 terminal for a connection and got no answer in time. What the code means, what the forum thread that reports it found, and what to check before you run the script again.

- Last reviewed: 2026-09-23

Unverified in part: carried over from an earlier version of this site. The links below are the sources it was written from, but its statements have not been re-read at source since the date shown, so check anything you rely on.

## What to check

1. 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](https://openbrokerapi.com/errors/mt5/python-package-needs-windows).
2. Check that a MetaTrader 5 terminal is installed, running and logged in to your account before initialize() is called.
3. 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.
4. 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.
5. 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](https://openbrokerapi.com/platforms/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 metaTrader5](https://www.mql5.com/en/forum/480072)posted 22 Jan 2025, checked 21 Sep 2026
- [MQL5 docs: last_error](https://www.mql5.com/en/docs/python_metatrader5/mt5lasterror_py)checked 19 Sep 2026
- [MQL5 docs: initialize](https://www.mql5.com/en/docs/python_metatrader5/mt5initialize_py)checked 20 Sep 2026
- [MQL5 docs: MetaTrader for Python](https://www.mql5.com/en/docs/python_metatrader5)checked 20 Sep 2026
- [PyPI: MetaTrader5](https://pypi.org/project/MetaTrader5/)checked 21 Sep 2026
- [MetaQuotes company news: end of support for older terminals](https://www.metaquotes.net/en/company/news/5479)checked 20 Sep 2026

## More on the MetaTrader 5 API

- [MetaTrader 5 API quickstart](https://openbrokerapi.com/platforms/metatrader-5/quickstart): From credentials to a first call on a demo account, step by step.
- [MetaTrader 5 API error codes](https://openbrokerapi.com/errors/mt5): 311 decoded, each with what it means, and the fix where the source gives one.
- [MetaTrader 5 functions](https://openbrokerapi.com/platforms/metatrader-5/functions): 78 documented, each with its signature, arguments, return value and source.
- [MetaTrader 5 API page](https://openbrokerapi.com/platforms/metatrader-5): The full record: access, authentication, limits and the source for each.
- [Claude with MetaTrader 5: a safe, read-first setup](https://openbrokerapi.com/guides/claude-mt5): Guide
- [MetaTrader 5 for Python: which platforms does it run on?](https://openbrokerapi.com/guides/metatrader-5-python-platforms): Guide
- [MT5 trade history to a spreadsheet with Python](https://openbrokerapi.com/guides/mt5-trade-history-to-a-spreadsheet): Guide

## Licence and how to cite

The records behind this page are all rights reserved. This file is the page itself, at its own address, in another format. It is not part of the CC BY 4.0 downloads listed at https://openbrokerapi.com/data. Quote from it with a link to the page.

Cite as: MT5 Python initialize() failed: error -10005, IPC timeout. Broker API Hub, https://openbrokerapi.com/errors/mt5/ipc-timeout-10005, newest check 2026-09-23.

Where you rely on a single figure, cite the source and the checked date printed beside it as well. Where this page and a broker's own documentation differ, the documentation wins.
