What to check
- In each MetaTrader 5 terminal on the machine, open Help, then About, and note its build.
- Check which terminal your script starts. If there is more than one, pass the full path of the one you mean to
initialize(path=...). - If the builds differ, you have the situation the thread describes, and that is the first thing to resolve.
- Check the terminal is build 4755 or later, the oldest MetaQuotes has supported since 1 Jul 2025.
- Check the package:
pip show MetaTrader5prints the installed version. The newest on PyPI when we read it was 5.0.6231, released 27 Sep 2026. - Print
mt5.last_error()whenever initialize() returns False, so that if the call does come back you have a code to look up in the MetaTrader 5 internal error codes.
The build mismatch is what the thread reports. The steps are checks we suggest to find out whether you have the same problem, not fixes reported in the thread.
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 connects to a running MetaTrader 5 terminal over interprocess communication, so the Python side and the terminal have to be able to talk to each other before initialize() can return.
In the thread of 31 Aug 2025 the hang came with a mismatch between build 5233 and build 5238. The thread gives the two numbers. It does not give a general rule for which build to run, and neither do we.
Questions
Why does mt5.initialize() hang instead of returning an error?
The MQL5 forum thread of 31 Aug 2025 does not explain the mechanism. What it reports is that the hang came with a build mismatch, 5233 against 5238.
Which MetaTrader 5 build do I need for Python?
MetaQuotes has supported terminals from build 4755 onwards since 1 Jul 2025. Above that minimum, the problem in the thread was two builds that did not match, not one build being too old.
How do I see my MetaTrader 5 terminal build?
In the terminal, open Help, then About. Check every copy installed on the machine, not only the one you open by hand.
Does updating the MetaTrader5 package fix the hang?
The thread does not say so. Compare the installed version from pip show MetaTrader5 with the newest on PyPI, 5.0.6231 of 27 Sep 2026, as one of the things you rule out.
Sources
- MQL5 forum: Help request for MetaTrader5 initialization with Pythonposted 31 Aug 2025, checked 21 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