My Question Is:
I am trying to package a simple code which is mentioned below that has import ibm_db, but I am not able to do it, as it is giving me the below-mentioned error. I have researched a lot on SO and other websites, but most of the solutions that I have encountered say to add the DLL's using --add-binary, I have tried that as well, but still, I am getting the below-mentioned error.
I am using a Windows 10 64-Bit OS, x64-based processor.
I am using a virtual environment created using python -m venv env
The packages mentioned below are installed in my virtual environment.
I hope all these details are enough and qualify as a question.
-- PYTHON VERSION --
Python 3.7.8
-- PYTHON PACKAGES INSTALLED --
altgraph 0.17
future 0.18.2
ibm-db 3.0.2
pefile 2019.4.18
pip 20.1.1
PyInstaller 3.6
pywin32-ctypes 0.2.0
setuptools 47.1.0
-- MY CODE --
import ibm_db<br>
print(ibm_db.`__version__`)<br>
-- USING PYINSTALLER TO CREATE PACKAGE FOR MY ABOVE CODE --
pyinstaller --noconfirm ^
--name=test ^
--hidden-import "pkg_resources.py2_warn" ^
--add-binary C:\Users\vrajendrasinghpar\Desktop\test\env\Lib\site-packages\ibm_db_dlls\ibm_db.dll;.\ibm_db_dlls ^
test_ibm_db.py
-- GETTING THE BELOW ERROR --
Traceback (most recent call last):<br>
File "test\test_ibm_db.py", line 1, in `<module>`<br>
File "c:\users\vrajendrasinghpar\desktop\test\env\lib\site-packages\PyInstaller\loader\pyimod03_importers.py", line 623, in exec_module<br>
exec(bytecode, module.`__dict__`)<br>
File "lib\site-packages\ibm_db.py", line 28, in `<module>`<br>
File "lib\site-packages\ibm_db.py", line 26, in `__bootstrap__`<br>
File "imp.py", line 345, in load_dynamic<br>
ImportError: DLL load failed: The specified module could not be found.<br>
[27420] Failed to execute script test_ibm_db<br>