Broker API HubMenu

MetaTrader5 Python package on Linux and macOS: it needs Windows

The official MetaTrader5 package for Python runs on Windows only. On Linux or a Mac, pip has no build for your system, and the MQL5 forum answer is that you need Windows Python. What the sources say and the routes people use.

Independent and unofficialLast reviewed

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.

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 what you are running: python -c "import sys, platform; print(sys.platform, platform.machine())". The package's wheels are for Windows on x86-64, which prints win32 and AMD64.
  2. The route the forum thread gives: Windows Python, next to a MetaTrader 5 terminal. On a Mac or a Linux machine that means a Windows environment of some kind; a separate Windows machine or virtual machine is the plain case.
  3. A community route: psyb0t/mt5-httpapi runs the Windows only terminal in Docker or QEMU and puts REST and MCP in front of it. Community code under the WTFPL licence, and we have not checked how it handles credentials.
  4. If all you need is your trade history, you may not need Python at all: MetaTrader 4 and 5 trade history, no code.

Step 2 is what the thread reports. Steps 1, 3 and 4 are ours.

Next steps for this error

Why it happens

The package is a bridge to the MetaTrader 5 terminal, which it reaches by interprocess communication on the same machine, and it is published for win32 and win_amd64 (Windows) only. So it is not only a question of whether Python installs: the terminal it talks to has to be running there too.

Tools built on top of MetaTrader 5 meet the same wall. The community metatrader-mcp-server tracker carries reports from Linux and macOS users running without a terminal (#29 and #32).

Questions

Can I pip install MetaTrader5 on macOS?

Not natively. PyPI publishes the package, 5.0.6231 of 27 Sep 2026 when we read it, as wheels for win32 and win_amd64 only, so pip on macOS has no build to install.

Does the MetaTrader5 Python package work on Linux?

Not as a Linux package. The MQL5 forum answer of 22 Jan 2025 is that Linux and Mac users need Windows Python, and the package also needs a running MetaTrader 5 terminal to connect to.

Why does an MT5 MCP server fail on my Mac?

The community metatrader-mcp-server has reports from Linux and macOS users running without a terminal (#29 and #32). Whichever server you use, it needs a MetaTrader 5 terminal it can reach.

Is there a Docker image for MetaTrader 5?

One community project we list, psyb0t/mt5-httpapi, runs the terminal in Docker or QEMU with REST and MCP in front. It is not MetaQuotes' own, and we have not checked how it handles credentials.

Sources

Sections