Problem with 'pip install MetaTrader5' - MetaTrader module for integration with Python

 

Hi,

Everything is OK with my Python environment in which I work every day, but when I want to import the MetaTrader5 library, I get an error message  :

ERROR: Could not find a version that satisfies the requirement MetaTrader5 (from versions: none)

ERROR: No matching distribution found for MetaTrader5

Where is the repository for MetaTrader5 lib ?

Thanks


https://www.mql5.com/en/docs/integration/python_metatrader5

  1. Download the latest version of Python 3.8 from https://www.python.org/downloads/windows
  2. When installing Python, check "Add Python 3.8 to PATH%" to be able to run Python scripts from the command line.
  3. Install the MetaTrader 5 module from the command line
  pip install MetaTrader5

Download Python
Download Python
  • www.python.org
The official home of the Python Programming Language
 
I managed to set up my environment, but attempts to connect to the terminal were futile and time consuming. I gave up.
edit: ... plus, I couldn't backtest resulting strategies.
 
Anonymous3 Geek :
I managed to set up my environment, but attempts to connect to the terminal were futile and time consuming. I gave up.

Thank you for your answer. I will come and put an answer if I ever find the solution to my problem.

 
OK, it doesn't work on Mac or Linux.
You absolutely have to be on Windows.
 


Hey, it seems the package is only available on windows.. Can't get it from linux/ Mac

 

Yes, I have same issue.

I can install the MT5 platform by using Wine 6.0 in Ubuntu 18.04

But I cannot install the package:

pip install MetaTrader5

The error:

ERROR: Could not find a version that satisfies the requirement MetaTrader5

ERROR: No matching distribution found for MetaTrader5
Have any solution?


 

I think I have a solution that might work for linux.


The only way this can be done is to install the windows version of python inside of wine and run it from there. it works if I run the python script from the wine CMD (not the terminal) while metatrader is running on the same wine version.


I think that's because it depends on inter-processor communication tech from some windows DLL.


I hope this helps. feel free to contact me if it does not work for you that way on linux.

 

I'm sorry to hear that, although a credit for you for tiring to help.

Linux is the natural environment for python.

Installing python inside a wine virtual environment is dam stupid, while you can simply install Meta Trader 5 itself on wine.

Why MetaQuotes, which maintains the MetaTrader5 python package, does not fix the issue and compile it simply for Linux and Mac ???

 
toogood #:

I'm sorry to hear that, although a credit for you for tiring to help.

Linux is the natural environment for python.

Installing python inside a wine virtual environment is dam stupid, while you can simply install Meta Trader 5 itself on wine.

Why MetaQuotes, which maintains the MetaTrader5 python package, does not fix the issue and compile it simply for Linux and Mac ???

I agree - many IT savvy mt5 users must be really disappointed at this lack of non-windows functionality

 
I'm on Ubuntu 22.04 and successfully installed MetaTrader5, here are the steps.

- sudo apt update -y
- sudo apt upgrade -y
- sudo apt install wine64
- cd ~/Desktop
- wget https://www.python.org/ftp/python/3.8.0/python-3.8.0-amd64.exe --no-check-certificate
- wine64 uninstaller -> select install and then select mt5setup.exe
- wine64 cmd
- cd /folder_where_python3.8_setup.exe
- python-3.8.0-amd64.exe
- c:
- cd windows
- copy py.exe python.exe
- python -m pip install pip --upgrade
- exit
- wine64 cmd
- pip3 --version
- pip3 install jupyter
- pip3 install MetaTrader5
- jupyter notebook

This seems to work, I can access MetaTrader5 repository however jupyter crashes when any ipynb file is loaded. Haven't found any solution for this problem but if you save everything in a .py file and execute it normally, it works fine.
 
still having the same problem, Python fail to connect with MetaTrader5 module on my windows 10 pc
Reason: