'Issue with making executive file out of Python code

Currently I'm trying to make an exe file from a python code, which is a trading bot for forex. In this case I'm using the standard API for Metatrader 5. In line with this the user package Metatrader 5 should be imported to be used for different trading commands. When I make an exe file using pyinstaller -F I encounter the error user package Metatrader 5 not found, after running the exe file. One step further I have copied two related folders from the install packages folder of python, into the main folder where I try to generate the exe file. After compiling and running the exe file another error comes, which says: DLL load failed while importing _core: the given module was not found. It is to be mentioned that this error refers to the init.py in MetaTrader 5 folder, where the author trys to enter the C methods to the module:

# import C methods to our module from ._core import *

Any ideas on how this can be fixed?



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source