So, basically I've created .exe file from py code by using pyInstaller, and it works perfectly fine on my machine.
But when I try to execute it at another pc, it raises ImportError like that
Traceback (most recent call last):
File "opty.py", line 10, in <module>
File "PyInstaller\loader\pyimod03_importers.py", line 495, in exec_module
File "paramiko\__init__.py", line 22, in <module>
File "PyInstaller\loader\pyimod03_importers.py", line 495, in exec_module
File "paramiko\transport.py", line 129, in <module>
File "paramiko\transport.py", line 190, in Transport
File "paramiko\kex_curve25519.py", line 30, in is_available
File "cryptography\hazmat\primitives\asymmetric\x25519.py", line 39, in generate
File "PyInstaller\loader\pyimod03_importers.py", line 495, in exec_module
File "cryptography\hazmat\backends\openssl\__init__.py", line 6, in <module>
File "PyInstaller\loader\pyimod03_importers.py", line 495, in exec_module
File "cryptography\hazmat\backends\openssl\backend.py", line 113, in <module>
File "PyInstaller\loader\pyimod03_importers.py", line 495, in exec_module
File "cryptography\hazmat\bindings\openssl\binding.py", line 14, in <module>
ImportError: DLL load failed while importing _openssl: The specified module could not be
found.
So, basically the way how I converted py file into exe file is
pyinstaller.exe --onefile --windowed --icon="required\icons.ico" opty.py --upx-
dir="D:\rabbani\app\upx-3.96-win64"
I've tried different variations like using onedirectory, auto-py-to-exe, manually adding _ssl.ddl to the generated dist folder.
p.s. I have windows 10, python 3.9, PyInstaller 5.1.