metatrader error when trying to login with Python, error code = (-10005, 'IPC timeout')

You are missing trading opportunities:
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
Registration
Log in
You agree to website policy and terms of use
If you do not have an account, please register
I am trying to login to Metatrader account and I have been receiving this error code.
Please see code below;
I first import necessary libraries and initialize which works fine
But when I try to log in using the below code, I receive this error -
failed to connect at account #51166970, error code: (-10005, 'IPC timeout')
I also read some post about similar errors which asked I specify the path, please see post links (https://stackoverflow.com/questions/58028717/metatrader5-libarary-in-python-3-7 and https://stackoverflow.com/questions/63975284/mt5-metatrader-5-connect-to-different-mt5-terminals-using-python and https://www.mql5.com/en/forum/438477), so I edited my code but received this error - initialize() failed, error code = (-10005, 'IPC timeout')
As noted in an answer here (https://stackoverflow.com/questions/66492735/metatrader-error-initialize-failed-error-code-10005-ipc-timeout/72851156#72851156) I changed my path from
"C:\Program Files\MetaTrader 5\terminal64.exe"
to
"C:/Program Files/MetaTrader 5/terminal64.exe"
How can I rectify this