Why can't I connect to my MT5 via python?

 
import MetaTrader5 as mt5



# display data on the MetaTrader 5 package

print("MetaTrader5 package author: ", mt5.__author__)

print("MetaTrader5 package version: ", mt5.__version__)



# establish connection to the MetaTrader 5 terminal


if not mt5.initialize(path="C:\\Program Files\\FTMO MetaTrader 5\\terminal64.exe",server="FTMO-Server",login=mylogin,
password="mypass"):
    
        print("initialize() failed, error code =",mt5.last_error())
    
        quit()

else:
    
        print("initialized success!")

I get the following error:

MetaTrader5 package author:  MetaQuotes Ltd.
MetaTrader5 package version:  5.0.44
initialize() failed, error code = (-10003, "IPC initialize failed, Pipe server didn't answer in 60 sec")
Process finished with exit code 0

It's a very simple script to test connection but it is not letting me connect. Can it be the broker blocking it?

I did try updating versions of MetaTrader5 to 5.0.45 (latest) didn't work either

 
Fernando Carreiro #:
Problem with 'pip install MetaTrader5' - MetaTrader module for integration with Python

Thank you Fernando!!!

Didn't see that in the documentation: Documentation on MQL5: Python Integration

initialized success!
Process finished with exit code 0
Documentation on MQL5: Python Integration
Documentation on MQL5: Python Integration
  • www.mql5.com
Python Integration - MQL5 Reference - Reference on algorithmic/automated trading language for MetaTrader 5
 
Fernando Carreiro #:


I still can't work even though I ticked all the options in Community. The console printed the error, initialize() failed, error code = (-10003, "IPC initialize failed, Pipe server didn't answer in 60 sec").
Do you have any idea?
Feel exhausted...