Skip to content

Use the MetaTrader5 Python package on a Mac

Updated 2026-11-11

pip install MetaTrader5 fails on macOS because MetaQuotes publishes the package only as Windows x86-64 wheels, so pip finds no version for your Mac. The package also needs a logged-in MT5 terminal running on the same Windows machine. On a Mac you can run Windows in a virtual machine, run the terminal under Wine, or call a hosted MT5 API such as FiveSocket from ordinary Python.

7-day free trial. Paid plans start at $9.99 a month. See pricing

What the error means

$ python3 -m pip install MetaTrader5
ERROR: Could not find a version that satisfies the requirement MetaTrader5 (from versions: none)
ERROR: No matching distribution found for MetaTrader5

As of November 2026, version 5.0.6231 on PyPI has wheels for CPython 3.6 to 3.14, all built for Windows x86-64. There is no source package, so pip on macOS has nothing it can install. A newer Python, a virtual environment or Homebrew does not change that.

Even on Windows, the package does not talk to your broker. It talks to an MT5 terminal running on the same computer, which must be installed and logged in.

Your options on a Mac

Ways to use MT5 from Python on macOS
OptionHow it worksWhat it costs you
Windows virtual machineRun Windows, MT5 and Windows Python in a VM such as Parallels or UTM.A Windows licence, memory, and a VM that must stay on while your code runs.
WineRun the MT5 terminal and a Windows Python under Wine. mt5linux bridges calls from your Mac Python over RPyC.Setup time, and fixes when Wine, macOS or MT5 updates break it.
Docker imageRun a container with MT5 under Wine, such as gmag11/MetaTrader5-Docker, which also gives a VNC desktop.At least 4 GB of RAM per container, plus image upkeep.
Windows VPSRent a Windows server and run the official package there.A monthly VPS bill, Windows updates and terminal restarts.
Hosted APIA service runs the terminal. Your Mac Python sends HTTPS requests.A monthly fee, and no tick stream or Expert Advisors with FiveSocket.

Python on a Mac with FiveSocket

This runs in any Python 3 on macOS with the requests package. It reads the first linked account's balance and waits if the MT5 session is still logging in.

import os
import time
import requests

base = "https://api.fivesocket.com/v1"
headers = {"Authorization": f"Bearer {os.environ['FIVESOCKET_KEY']}"}

accounts = requests.get(f"{base}/accounts", headers=headers, timeout=30)
accounts.raise_for_status()
account_id = accounts.json()["data"][0]["id"]

while True:
    response = requests.get(f"{base}/accounts/{account_id}/balance", headers=headers, timeout=60)
    if response.status_code != 202:
        break
    time.sleep(int(response.headers.get("Retry-After", "5")))

response.raise_for_status()
account = response.json()
print(account["balance"], account["equity"], account["currency"])

Positions, closed trades, deals and orders work the same way. Orders need trading turned on for the account first.

Limits

  • The API is not a drop-in replacement for the MetaTrader5 package. Function calls such as mt5.account_info() become HTTPS requests.
  • There is no tick stream, so copy_ticks_from and similar calls have no equivalent.
  • The first read after a session goes idle can take several seconds while MT5 logs in.

Trading leveraged FX and CFDs carries a high risk of losing money quickly. Try any new setup on a demo account first. FiveSocket connects software to your account, and neither FiveSocket nor an AI assistant's output is investment advice.

Frequently asked questions

Does the MetaTrader5 package work on Apple silicon?
No. It has only Windows x86-64 wheels, so it does not install in macOS Python on Intel or Apple silicon.
Is there an MT5 app for macOS?
MetaQuotes offers MT5 for Mac, but the Python package still installs only on Windows Python.
How much does FiveSocket cost?
Plans start at $9.99 a month for one MT5 account. Link your MT5 account and try it free, no card: 24 hours or 100 calls, whichever comes first. Then a 7-day free trial, card required. Cancel anytime. The trial includes one connected MT5 account.

Try it on your own account.

Link your MT5 account and try it free, no card: 24 hours or 100 calls, whichever comes first. Then a 7-day free trial, card required. Cancel anytime. The trial includes one connected MT5 account. Cancel before the trial ends and you are not charged. A demo account is the safest place to start.

7-day free trial. Paid plans start at $9.99 a month. See pricing