[BUG] libcrypto.so error when running bundled Python
Description
When running the bundled Python distribution, an error appears mentioning that libcrypto.so can not be found.
Setup
- [x] onedir packaging
- [x] VM (KVM)
Steps to Reproduce the behavior
Run any command involving Salt.
PS C:\Program Files\Salt Project\Salt> .\salt-call --versions-report
Error processing line 1 of C:\Program Files\Salt Project\Salt\lib\site-packages\relenv.pth:
Traceback (most recent call last):
File "C:\Program Files\Salt Project\Salt\lib\site.py", line 195, in addpackage
exec(line)
File "<string>", line 1, in <module>
File "C:\Program Files\Salt Project\Salt\lib\site-packages\relenv\runtime.py", line 1040, in bootstrap
setup_openssl()
File "C:\Program Files\Salt Project\Salt\lib\site-packages\relenv\runtime.py", line 862, in setup_openssl
set_openssl_modules_dir(str(sys.RELENV / "lib" / "ossl-modules"))
File "C:\Program Files\Salt Project\Salt\lib\site-packages\relenv\runtime.py", line 946, in set_openssl_modules_dir
libcrypto = ctypes.CDLL(cryptopath)
File "C:\Program Files\Salt Project\Salt\lib\ctypes\__init__.py", line 374, in __init__
self._handle = _dlopen(self._name, mode)
FileNotFoundError: Could not find module 'C:\Program Files\Salt Project\Salt\lib\libcrypto.so' (or one of its dependencies). Try using the full path with constructor syntax.
Remainder of file ignored
Salt Version:
Salt: 3006.14
Python Version:
Python: 3.10.17 (heads/main:9a0f3fa, Jul 2 2025, 22:14:50) [MSC v.1944 64 bit (AMD64)]
Dependency Versions:
cffi: 1.14.6
cherrypy: 18.6.1
cryptography: 42.0.5
dateutil: 2.8.1
docker-py: Not Installed
gitdb: 4.0.7
gitpython: 3.1.41
Jinja2: 3.1.6
libgit2: Not Installed
looseversion: 1.0.2
M2Crypto: Not Installed
Mako: Not Installed
msgpack: 1.0.2
msgpack-pure: Not Installed
mysql-python: Not Installed
packaging: 24.0
pycparser: 2.21
pycrypto: Not Installed
pycryptodome: 3.19.1
pygit2: Not Installed
python-gnupg: 0.4.8
PyYAML: 6.0.1
PyZMQ: 25.0.2
relenv: 0.19.4
smmap: 4.0.0
timelib: 0.2.4
Tornado: 4.5.3
ZMQ: 4.3.4
System Versions:
dist:
locale: utf-8
machine: AMD64
release: 2021
system: Windows
version: 2021 10.0.19044 SP0 Multiprocessor Free
Same for me. I just installed 3006.14 on Windows and then:
Or:
C:\Users\Kevin>salt-call --versions-report
Error processing line 1 of C:\Program Files\Salt Project\Salt\lib\site-packages\relenv.pth:
Traceback (most recent call last):
File "C:\Program Files\Salt Project\Salt\lib\site.py", line 195, in addpackage
exec(line)
File "<string>", line 1, in <module>
File "C:\Program Files\Salt Project\Salt\lib\site-packages\relenv\runtime.py", line 1040, in bootstrap
setup_openssl()
File "C:\Program Files\Salt Project\Salt\lib\site-packages\relenv\runtime.py", line 862, in setup_openssl
set_openssl_modules_dir(str(sys.RELENV / "lib" / "ossl-modules"))
File "C:\Program Files\Salt Project\Salt\lib\site-packages\relenv\runtime.py", line 946, in set_openssl_modules_dir
libcrypto = ctypes.CDLL(cryptopath)
File "C:\Program Files\Salt Project\Salt\lib\ctypes\__init__.py", line 374, in __init__
self._handle = _dlopen(self._name, mode)
FileNotFoundError: Could not find module 'C:\Program Files\Salt Project\Salt\lib\libcrypto.so' (or one of its dependencies). Try using the full path with constructor syntax.
Remainder of file ignored
Salt Version:
Salt: 3006.14
Python Version:
Python: 3.10.17 (heads/main:9a0f3fa, Jul 2 2025, 22:14:50) [MSC v.1944 64 bit (AMD64)]
Dependency Versions:
cffi: 1.14.6
cherrypy: 18.6.1
cryptography: 42.0.5
dateutil: 2.8.1
docker-py: Not Installed
gitdb: 4.0.7
gitpython: 3.1.41
Jinja2: 3.1.6
libgit2: Not Installed
looseversion: 1.0.2
M2Crypto: Not Installed
Mako: Not Installed
msgpack: 1.0.2
msgpack-pure: Not Installed
mysql-python: Not Installed
packaging: 24.0
pycparser: 2.21
pycrypto: Not Installed
pycryptodome: 3.19.1
pygit2: Not Installed
python-gnupg: 0.4.8
PyYAML: 6.0.1
PyZMQ: 25.0.2
relenv: 0.19.4
smmap: 4.0.0
timelib: 0.2.4
Tornado: 4.5.3
ZMQ: 4.3.4
System Versions:
dist:
locale: utf-8
machine: AMD64
release: 10
system: Windows
version: 10 10.0.19045 SP0 Multiprocessor Free
same with 3007.6
salt-call --versions-report
Error processing line 1 of C:\Program Files\Salt Project\Salt\lib\site-packages\relenv.pth:
Traceback (most recent call last):
File "C:\Program Files\Salt Project\Salt\lib\site.py", line 195, in addpackage
exec(line)
File "<string>", line 1, in <module>
File "C:\Program Files\Salt Project\Salt\lib\site-packages\relenv\runtime.py", line 1040, in bootstrap
setup_openssl()
File "C:\Program Files\Salt Project\Salt\lib\site-packages\relenv\runtime.py", line 862, in setup_openssl
set_openssl_modules_dir(str(sys.RELENV / "lib" / "ossl-modules"))
File "C:\Program Files\Salt Project\Salt\lib\site-packages\relenv\runtime.py", line 946, in set_openssl_modules_dir
libcrypto = ctypes.CDLL(cryptopath)
File "C:\Program Files\Salt Project\Salt\lib\ctypes\__init__.py", line 374, in __init__
self._handle = _dlopen(self._name, mode)
FileNotFoundError: Could not find module 'C:\Program Files\Salt Project\Salt\lib\libcrypto.so' (or one of its dependencies). Try using the full path with constructor syntax.
Remainder of file ignored
Salt Version:
Salt: 3007.6
Python Version:
Python: 3.10.14 (heads/main:c1ec015, Apr 3 2024, 21:36:37) [MSC v.1938 64 bit (AMD64)]
Dependency Versions:
cffi: 1.16.0
cherrypy: 18.8.0
cryptography: 42.0.5
dateutil: 2.8.2
docker-py: Not Installed
gitdb: 4.0.10
gitpython: Not Installed
Jinja2: 3.1.6
libgit2: Not Installed
looseversion: 1.3.0
M2Crypto: Not Installed
Mako: Not Installed
msgpack: 1.0.7
msgpack-pure: Not Installed
mysql-python: Not Installed
packaging: 24.0
pycparser: 2.21
pycrypto: Not Installed
pycryptodome: 3.19.1
pygit2: Not Installed
python-gnupg: 0.5.2
PyYAML: 6.0.1
PyZMQ: 25.1.2
relenv: 0.19.4
smmap: 5.0.1
timelib: 0.3.0
Tornado: 6.4.2
ZMQ: 4.3.4
Salt Package Information:
Package Type: onedir
System Versions:
dist:
locale: utf-8
machine: AMD64
release: 2019Server
system: Windows
version: 2019Server 10.0.17763 SP0 Multiprocessor Free
Possibly fixed here: https://github.com/saltstack/relenv/pull/226 Which would be part of this: https://github.com/saltstack/salt/pull/68187
@twangboy Do we know which version will include those fixes that you mention above?
It will be in the next salt releases 3006.15 / 3007.7