MT5 Python API on Mac and Linux

The official MetaTrader5 Python package installs only on Windows, and it talks to an MT5 terminal running on the same machine. On a Mac or a Linux computer you have four options: run MT5 and a Windows Python under Wine, use a bridge or a Docker image, use a Windows VPS or virtual machine, or call a hosted API that runs MT5 for you. This guide covers each one.

By FundedOps team

Why does pip install MetaTrader5 fail on a Mac?

Because the package ships Windows builds only. Its latest release, 5.0.6231 from September 2026, has builds for 64-bit Windows and Python 3.6 to 3.14, and none for macOS, Linux or ARM, so pip on a Mac or Linux machine finds no matching distribution. The package also needs an MT5 terminal running on the same machine, which it starts when required.

Option 1: Wine with a Windows Python

MetaQuotes' own Mac app and Linux installer already run MT5 inside Wine, a layer that runs Windows programs. You can install a Windows build of Python into the same Wine setup and install MetaTrader5 there. It costs nothing, but it is the most fragile route: every package your code uses, pandas and Jupyter included, has to run inside that Windows Python, and an MT5 or Wine update can stop it working.

Option 2: a bridge or a Docker image

Bridges such as mt5linux and mt5-remote run a small server next to the terminal under Wine and give your normal Mac or Linux Python a look-alike MetaTrader5 module over the network. siliconmetatrader5 does the same for Apple Silicon Macs. Docker images such as gmag11/MetaTrader5-Docker bundle MT5, Wine and a bridge in one container. These keep the official API and are free, but they are community projects that can break when Wine or MT5 updates, and the Docker images run only on Intel and AMD machines.

Option 3: a Windows VPS or virtual machine

This is the setup MetaQuotes supports: real Windows, with the official package used as documented. You pay for a Windows server or run Windows in a virtual machine. On Apple Silicon Macs, Parallels runs the Arm version of Windows, and Parallels' own support notes say recent MT5 builds may not launch there.

Option 4: a hosted MetaTrader API

A hosted API runs the MT5 terminal for you, so your code calls it over HTTPS from any computer with a normal Python package. FundedOps is one: pip install fundedops works on macOS, Linux and Windows with Python 3.10 or later, for MT4 and MT5 accounts. The trade-off is that you use the provider's API instead of the MetaTrader5 module, so existing code needs porting. Your first account is free for 15 days, then $8 per account every 30 days. Comparing providers? See FundedOps vs MetaApi.

from fundedops import FundedOps

client = FundedOps(api_key="fo_live_...")

account = client.accounts.create(
    login="1234567",
    password="your-investor-password",  # read-only; goes in the password field
    server="ICMarketsSC-Demo",
    platform="mt5",
    name="Prod monitor",
)
print(account.id, account.state)  # e.g. "…", "deploying"

# Blocks until connectionStatus == "connected". Raises DeployFailedError if the
# account cannot connect, or TimeoutError after 180s.
account = client.wait_until_connected(account.id, timeout=180)
print(account.state, account.connection_status)  # "deployed" "connected"
print(account.credential_type)                    # "investor" (read-only, auto-detected)

info = client.accounts.account_information(account.id)
print(info.balance, info.equity, info.currency)

page = client.accounts.positions(account.id)
for p in page.positions:
    print(p.symbol, p.type, p.volume, p.profit)

Which option should you use?

  • On a Linux server or an Intel or AMD desktop, wanting the official API for free: a Docker image or a bridge.
  • On an Apple Silicon Mac: a hosted API or a Windows VPS. Docker images and Parallels are unreliable there.
  • For code that runs unattended: a Windows VPS with the official package, or a hosted API, so nothing depends on Wine.
  • For several accounts from one app without running terminals: a hosted API.

Questions

Build on your MT4 and MT5 data

It costs $8 per account every 30 days. Your first account is free for 15 days for testing.