package_control
package_control copied to clipboard
Package Control not loaded on macOS Big Sur
I tried instaling the Package Control via Command Palette and even manually but it was not working, after some debugging I found that the ctypes file for python3.3 are not being correctly loaded
This is the relevant part in the debug
Traceback (most recent call last):
File "/Users/nicoskaralis/Library/Application Support/Sublime Text/Installed Packages/Package Control.sublime-package/package_control/deps/oscrypto/_openssl/_libcrypto_ctypes.py", line 305, in <module>
File "./python3.3/ctypes/__init__.py", line 366, in __getattr__
File "./python3.3/ctypes/__init__.py", line 371, in __getitem__
AttributeError: dlsym(0x7f876fc44440, EVP_PKEY_size): symbol not found
Here is the rest of the output log
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/Applications/Sublime Text.app/Contents/MacOS/Lib/python33/sublime_plugin.py", line 308, in reload_plugin
m = importlib.import_module(modulename)
File "./python3.3/importlib/__init__.py", line 90, in import_module
File "<frozen importlib._bootstrap>", line 1584, in _gcd_import
File "<frozen importlib._bootstrap>", line 1565, in _find_and_load
File "<frozen importlib._bootstrap>", line 1532, in _find_and_load_unlocked
File "/Applications/Sublime Text.app/Contents/MacOS/Lib/python33/sublime_plugin.py", line 1692, in load_module
exec(compile(source, source_path, 'exec'), mod.__dict__)
File "/Users/nicoskaralis/Library/Application Support/Sublime Text/Installed Packages/Package Control.sublime-package/2_bootstrap.py", line 26, in <module>
File "<frozen importlib._bootstrap>", line 1565, in _find_and_load
File "<frozen importlib._bootstrap>", line 1532, in _find_and_load_unlocked
File "/Applications/Sublime Text.app/Contents/MacOS/Lib/python33/sublime_plugin.py", line 1692, in load_module
exec(compile(source, source_path, 'exec'), mod.__dict__)
File "/Users/nicoskaralis/Library/Application Support/Sublime Text/Installed Packages/Package Control.sublime-package/package_control/bootstrap.py", line 20, in <module>
File "<frozen importlib._bootstrap>", line 1565, in _find_and_load
File "<frozen importlib._bootstrap>", line 1532, in _find_and_load_unlocked
File "/Applications/Sublime Text.app/Contents/MacOS/Lib/python33/sublime_plugin.py", line 1692, in load_module
exec(compile(source, source_path, 'exec'), mod.__dict__)
File "/Users/nicoskaralis/Library/Application Support/Sublime Text/Installed Packages/Package Control.sublime-package/package_control/download_manager.py", line 24, in <module>
File "<frozen importlib._bootstrap>", line 1565, in _find_and_load
File "<frozen importlib._bootstrap>", line 1532, in _find_and_load_unlocked
File "/Applications/Sublime Text.app/Contents/MacOS/Lib/python33/sublime_plugin.py", line 1692, in load_module
exec(compile(source, source_path, 'exec'), mod.__dict__)
File "/Users/nicoskaralis/Library/Application Support/Sublime Text/Installed Packages/Package Control.sublime-package/package_control/downloaders/__init__.py", line 20, in <module>
File "<frozen importlib._bootstrap>", line 1565, in _find_and_load
File "<frozen importlib._bootstrap>", line 1532, in _find_and_load_unlocked
File "/Applications/Sublime Text.app/Contents/MacOS/Lib/python33/sublime_plugin.py", line 1692, in load_module
exec(compile(source, source_path, 'exec'), mod.__dict__)
File "/Users/nicoskaralis/Library/Application Support/Sublime Text/Installed Packages/Package Control.sublime-package/package_control/downloaders/oscrypto_downloader.py", line 44, in <module>
File "<frozen importlib._bootstrap>", line 1565, in _find_and_load
File "<frozen importlib._bootstrap>", line 1532, in _find_and_load_unlocked
File "/Applications/Sublime Text.app/Contents/MacOS/Lib/python33/sublime_plugin.py", line 1692, in load_module
exec(compile(source, source_path, 'exec'), mod.__dict__)
File "/Users/nicoskaralis/Library/Application Support/Sublime Text/Installed Packages/Package Control.sublime-package/package_control/deps/oscrypto/tls.py", line 11, in <module>
File "<frozen importlib._bootstrap>", line 1565, in _find_and_load
File "<frozen importlib._bootstrap>", line 1532, in _find_and_load_unlocked
File "/Applications/Sublime Text.app/Contents/MacOS/Lib/python33/sublime_plugin.py", line 1692, in load_module
exec(compile(source, source_path, 'exec'), mod.__dict__)
File "/Users/nicoskaralis/Library/Application Support/Sublime Text/Installed Packages/Package Control.sublime-package/package_control/deps/oscrypto/_mac/tls.py", line 39, in <module>
File "<frozen importlib._bootstrap>", line 1565, in _find_and_load
File "<frozen importlib._bootstrap>", line 1532, in _find_and_load_unlocked
File "/Applications/Sublime Text.app/Contents/MacOS/Lib/python33/sublime_plugin.py", line 1692, in load_module
exec(compile(source, source_path, 'exec'), mod.__dict__)
File "/Users/nicoskaralis/Library/Application Support/Sublime Text/Installed Packages/Package Control.sublime-package/package_control/deps/oscrypto/_mac/util.py", line 208, in <module>
File "<frozen importlib._bootstrap>", line 1565, in _find_and_load
File "<frozen importlib._bootstrap>", line 1532, in _find_and_load_unlocked
File "/Applications/Sublime Text.app/Contents/MacOS/Lib/python33/sublime_plugin.py", line 1692, in load_module
exec(compile(source, source_path, 'exec'), mod.__dict__)
File "/Users/nicoskaralis/Library/Application Support/Sublime Text/Installed Packages/Package Control.sublime-package/package_control/deps/oscrypto/_openssl/_libcrypto.py", line 15, in <module>
File "<frozen importlib._bootstrap>", line 1565, in _find_and_load
File "<frozen importlib._bootstrap>", line 1532, in _find_and_load_unlocked
File "/Applications/Sublime Text.app/Contents/MacOS/Lib/python33/sublime_plugin.py", line 1692, in load_module
exec(compile(source, source_path, 'exec'), mod.__dict__)
File "/Users/nicoskaralis/Library/Application Support/Sublime Text/Installed Packages/Package Control.sublime-package/package_control/deps/oscrypto/_openssl/_libcrypto_ctypes.py", line 688, in <module>
Package Control.package_control.deps.oscrypto._ffi.FFIEngineError: Error initializing ctypes
reloading python 3.3 plugin Package Control.Package Control
Traceback (most recent call last):
File "/Users/nicoskaralis/Library/Application Support/Sublime Text/Installed Packages/Package Control.sublime-package/package_control/deps/oscrypto/_openssl/_libcrypto_ctypes.py", line 305, in <module>
File "./python3.3/ctypes/__init__.py", line 366, in __getattr__
File "./python3.3/ctypes/__init__.py", line 371, in __getitem__
AttributeError: dlsym(0x7f876fc44440, EVP_PKEY_size): symbol not found
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/Applications/Sublime Text.app/Contents/MacOS/Lib/python33/sublime_plugin.py", line 308, in reload_plugin
m = importlib.import_module(modulename)
File "./python3.3/importlib/__init__.py", line 90, in import_module
File "<frozen importlib._bootstrap>", line 1584, in _gcd_import
File "<frozen importlib._bootstrap>", line 1565, in _find_and_load
File "<frozen importlib._bootstrap>", line 1532, in _find_and_load_unlocked
File "/Applications/Sublime Text.app/Contents/MacOS/Lib/python33/sublime_plugin.py", line 1692, in load_module
exec(compile(source, source_path, 'exec'), mod.__dict__)
File "/Users/nicoskaralis/Library/Application Support/Sublime Text/Installed Packages/Package Control.sublime-package/Package Control.py", line 89, in <module>
File "<frozen importlib._bootstrap>", line 1565, in _find_and_load
File "<frozen importlib._bootstrap>", line 1532, in _find_and_load_unlocked
File "/Applications/Sublime Text.app/Contents/MacOS/Lib/python33/sublime_plugin.py", line 1692, in load_module
exec(compile(source, source_path, 'exec'), mod.__dict__)
File "/Users/nicoskaralis/Library/Application Support/Sublime Text/Installed Packages/Package Control.sublime-package/package_control/commands/__init__.py", line 3, in <module>
File "<frozen importlib._bootstrap>", line 1565, in _find_and_load
File "<frozen importlib._bootstrap>", line 1532, in _find_and_load_unlocked
File "/Applications/Sublime Text.app/Contents/MacOS/Lib/python33/sublime_plugin.py", line 1692, in load_module
exec(compile(source, source_path, 'exec'), mod.__dict__)
File "/Users/nicoskaralis/Library/Application Support/Sublime Text/Installed Packages/Package Control.sublime-package/package_control/commands/advanced_install_package_command.py", line 10, in <module>
File "<frozen importlib._bootstrap>", line 1565, in _find_and_load
File "<frozen importlib._bootstrap>", line 1532, in _find_and_load_unlocked
File "/Applications/Sublime Text.app/Contents/MacOS/Lib/python33/sublime_plugin.py", line 1692, in load_module
exec(compile(source, source_path, 'exec'), mod.__dict__)
File "/Users/nicoskaralis/Library/Application Support/Sublime Text/Installed Packages/Package Control.sublime-package/package_control/package_manager.py", line 34, in <module>
File "<frozen importlib._bootstrap>", line 1565, in _find_and_load
File "<frozen importlib._bootstrap>", line 1532, in _find_and_load_unlocked
File "/Applications/Sublime Text.app/Contents/MacOS/Lib/python33/sublime_plugin.py", line 1692, in load_module
exec(compile(source, source_path, 'exec'), mod.__dict__)
File "/Users/nicoskaralis/Library/Application Support/Sublime Text/Installed Packages/Package Control.sublime-package/package_control/downloaders/__init__.py", line 20, in <module>
File "<frozen importlib._bootstrap>", line 1565, in _find_and_load
File "<frozen importlib._bootstrap>", line 1532, in _find_and_load_unlocked
File "/Applications/Sublime Text.app/Contents/MacOS/Lib/python33/sublime_plugin.py", line 1692, in load_module
exec(compile(source, source_path, 'exec'), mod.__dict__)
File "/Users/nicoskaralis/Library/Application Support/Sublime Text/Installed Packages/Package Control.sublime-package/package_control/downloaders/oscrypto_downloader.py", line 44, in <module>
File "<frozen importlib._bootstrap>", line 1565, in _find_and_load
File "<frozen importlib._bootstrap>", line 1532, in _find_and_load_unlocked
File "/Applications/Sublime Text.app/Contents/MacOS/Lib/python33/sublime_plugin.py", line 1692, in load_module
exec(compile(source, source_path, 'exec'), mod.__dict__)
File "/Users/nicoskaralis/Library/Application Support/Sublime Text/Installed Packages/Package Control.sublime-package/package_control/deps/oscrypto/tls.py", line 11, in <module>
File "<frozen importlib._bootstrap>", line 1565, in _find_and_load
File "<frozen importlib._bootstrap>", line 1532, in _find_and_load_unlocked
File "/Applications/Sublime Text.app/Contents/MacOS/Lib/python33/sublime_plugin.py", line 1692, in load_module
exec(compile(source, source_path, 'exec'), mod.__dict__)
File "/Users/nicoskaralis/Library/Application Support/Sublime Text/Installed Packages/Package Control.sublime-package/package_control/deps/oscrypto/_mac/tls.py", line 39, in <module>
File "<frozen importlib._bootstrap>", line 1565, in _find_and_load
File "<frozen importlib._bootstrap>", line 1532, in _find_and_load_unlocked
File "/Applications/Sublime Text.app/Contents/MacOS/Lib/python33/sublime_plugin.py", line 1692, in load_module
exec(compile(source, source_path, 'exec'), mod.__dict__)
File "/Users/nicoskaralis/Library/Application Support/Sublime Text/Installed Packages/Package Control.sublime-package/package_control/deps/oscrypto/_mac/util.py", line 208, in <module>
File "<frozen importlib._bootstrap>", line 1565, in _find_and_load
File "<frozen importlib._bootstrap>", line 1532, in _find_and_load_unlocked
File "/Applications/Sublime Text.app/Contents/MacOS/Lib/python33/sublime_plugin.py", line 1692, in load_module
exec(compile(source, source_path, 'exec'), mod.__dict__)
File "/Users/nicoskaralis/Library/Application Support/Sublime Text/Installed Packages/Package Control.sublime-package/package_control/deps/oscrypto/_openssl/_libcrypto.py", line 15, in <module>
File "<frozen importlib._bootstrap>", line 1565, in _find_and_load
File "<frozen importlib._bootstrap>", line 1532, in _find_and_load_unlocked
File "/Applications/Sublime Text.app/Contents/MacOS/Lib/python33/sublime_plugin.py", line 1692, in load_module
exec(compile(source, source_path, 'exec'), mod.__dict__)
File "/Users/nicoskaralis/Library/Application Support/Sublime Text/Installed Packages/Package Control.sublime-package/package_control/deps/oscrypto/_openssl/_libcrypto_ctypes.py", line 688, in <module>
Package Control.package_control.deps.oscrypto._ffi.FFIEngineError: Error initializing ctypes
Any ideas on how to solve this?
I have the same problem with MacOS 12.1. In the past, the old MacOS has installed sublime text and upgraded to 12.1. This problem does not exist. OpenSSL version 2.8.3 can be used, but OpenSSL version 3.1.0 cannot be used
Same problem here as well, on MacOS Monterrey, using OpenSSL v3.0.1
Traceback (most recent call last):
File "/Users/aviftw/Library/Application Support/Sublime Text/Installed Packages/Package Control.sublime-package/package_control/deps/oscrypto/_openssl/_libcrypto_ctypes.py", line 305, in <module>
File "./python3.3/ctypes/__init__.py", line 366, in __getattr__
File "./python3.3/ctypes/__init__.py", line 371, in __getitem__
AttributeError: dlsym(0x2214322e0, EVP_PKEY_size): symbol not found
For me it was due to brew-installed openssl versions conflict. I had v1.1 (works) and 3 (doesn't).
$ ls -l
/usr/local/lib/libcrypto.dylib -> /usr/local/opt/openssl@3/lib/libcrypto.dylib
$ grep EVP_PKEY_size /usr/local/lib/libcrypto.dylib
$ grep EVP_PKEY_size /usr/local/Cellar/[email protected]/1.1.1n/lib/libcrypto.dylib
Binary file /usr/local/Cellar/[email protected]/1.1.1n/lib/libcrypto.dylib matches
# fixed by linking v1.1
$ sudo ln -sf /usr/local/Cellar/[email protected]/1.1.1n/lib/libcrypto.dylib /usr/local/lib/libcrypto.dyli
@rgaudin there's a typo in your final line (missing the b in dylib)
For others, the command that should fix this issue (at least on OS Monterey)
brew install [email protected] && ln -sf $(set -- `brew --cellar [email protected]`/1.1.1? && echo "$1")/lib/libcrypto.dylib /usr/local/lib/
# or for an exact command:
ln -sf /usr/local/Cellar/[email protected]/1.1.1o/lib/libcrypto.dylib /usr/local/lib/
EDIT: note that the command suggested by @rgaudin includes the path [email protected]/1.1.1n but my installation had the path [email protected]/1.1.1o instead, so I designed the top version of the above command to be more portable.
@rgaudin there's a typo in your final line (missing the
bindylib)For others, the command that should fix this issue (at least on OS Monterey)
brew install [email protected] && ln -sf $(set -- `brew --cellar [email protected]`/1.1.1? && echo "$1")/lib/libcrypto.dylib /usr/local/lib/ # or for an exact command: ln -sf /usr/local/Cellar/[email protected]/1.1.1o/lib/libcrypto.dylib /usr/local/lib/EDIT: note that the command suggested by @rgaudin includes the path
[email protected]/1.1.1nbut my installation had the path[email protected]/1.1.1oinstead, so I made the first version of the command above to be more portable.
Running ln -sf /usr/local/Cellar/[email protected]/1.1.1o/lib/libcrypto.dylib /usr/local/lib/ solved the issue for me. Thanks.
Running
ln -sf /usr/local/Cellar/[email protected]/1.1.1o/lib/libcrypto.dylib /usr/local/lib/solved the issue for me. Thanks.
if i install sublime text 4126 using official sublimetext, will i face this issues? or while installing brew for the first time on mac will cause this on silicon mac? i'm glad that u found a fix!
if i install sublime text 4126 using official sublimetext, will i face this issues? or while installing brew for the first time on mac will cause this on silicon mac?
Most likely, any installation on Big Sur or above will face this issue.
This issue stems from the fact that PackageControl, like many programs, still relies on older versions of OpenSSL (and is not compatible newer versions of the library). The version of the library libcrypto.dylib, which is linked from OpenSSL, is the crucial factor here. This library is not something provided by Sublime. In other words, the way you install Sublime probably doesn't matter (if the app came bundled with the appropriate library, then it wouldn't matter which method you use to install it, because the regular download doesn't use an installer wizard to pull down dependencies).
Probably, the best long term fix would be to bundle libcrypto.dylib with the PackageControl installation, to ensure correct versioning. Or to upgrade the dependency, to prevent potential SSL exploits in older versions.
EDIT: I was corrected, ST3 does ship with libcrypto, however the PackageControl implementation relies on the OS' installation instead, due to incompatibility with openssl 3.x (which is the version that ships with ST)
but in the contents of the app directory, there are libcrypto.1.1.dylib as well as libssl.1.1.dylib , so is the issue with symlink?
or can it be done in this way, that sublime will only use the backdated library instead of making it the default one.
Please don't quote previous comments all over the time!
That said, Package Control uses oscrypto python package for HTTPS communication, because ST2 and first releases of ST3 didn't support SSL. oscrypto relies on ssl libraries from OS as the name says.
Package Control fails loading as openssl 3 ABI changed in ways which cause import errors, so needed modules are not loaded.
Otherwise using urllib downloader would probably fix the issue as it uses ST's bundled openssl libraries these days.
I have the same issue. I am running MacOS Monterey 12.6 and a freshly installed version of Sublime Text 3 (Build 1426). When I install Package Control, it seems to install correctly but cannot be used. Package Control is not in my "ignored packages" as in some other users' issues. When I try to go into the Package Control settings - everything is greyed out (see below)
@nbrooks09 — the screenshot you've attached appears to be an unrelated problem. You have libcrypto installed correctly, however your installation is built for the x86 architecture used by Intel macs, while your Sublime console output says that you need the arm64 build (i.e. you have an M1 mac, and therefore need the M1-compatible libcrypto).
You may be able to solve this by replacing your Homebrew installation (if you use one) to the ARM-based Homebrew, or by manually building arm64 libcrypto, or you might be able to find an answer in this openssl github issue.
If someone with an M1 mac find a solution, please let us know!
@faelin thanks for this!
I had the ARM-based Homebrew installed already.
What worked for me was to move libcrypto.dylib.
I have the same problem on Arch Linux now where it appears to find libcrypto.so.3 instead of the also available libcrypto.so.1.1
reloading python 3.3 plugin Package Control.2_bootstrap
Traceback (most recent call last):
File "/home/mhm/.config/sublime-text/Packages/Package Control/package_control/deps/oscrypto/_openssl/_libcrypto_ctypes.py", line 305, in <module>
P_EVP_PKEY
File "./python3.3/ctypes/__init__.py", line 366, in __getattr__
File "./python3.3/ctypes/__init__.py", line 371, in __getitem__
AttributeError: /usr/lib/libcrypto.so.3: undefined symbol: EVP_PKEY_size
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/opt/sublime_text/Lib/python33/sublime_plugin.py", line 308, in reload_plugin
m = importlib.import_module(modulename)
File "./python3.3/importlib/__init__.py", line 90, in import_module
File "<frozen importlib._bootstrap>", line 1584, in _gcd_import
File "<frozen importlib._bootstrap>", line 1565, in _find_and_load
File "<frozen importlib._bootstrap>", line 1532, in _find_and_load_unlocked
File "/opt/sublime_text/Lib/python33/sublime_plugin.py", line 1692, in load_module
exec(compile(source, source_path, 'exec'), mod.__dict__)
File "/home/mhm/.config/sublime-text/Installed Packages/Package Control.sublime-package/2_bootstrap.py", line 26, in <module>
File "<frozen importlib._bootstrap>", line 1565, in _find_and_load
File "<frozen importlib._bootstrap>", line 1532, in _find_and_load_unlocked
File "/opt/sublime_text/Lib/python33/sublime_plugin.py", line 1692, in load_module
exec(compile(source, source_path, 'exec'), mod.__dict__)
File "/home/mhm/.config/sublime-text/Installed Packages/Package Control.sublime-package/package_control/bootstrap.py", line 20, in <module>
File "<frozen importlib._bootstrap>", line 1565, in _find_and_load
File "<frozen importlib._bootstrap>", line 1532, in _find_and_load_unlocked
File "/opt/sublime_text/Lib/python33/sublime_plugin.py", line 1692, in load_module
exec(compile(source, source_path, 'exec'), mod.__dict__)
File "/home/mhm/.config/sublime-text/Installed Packages/Package Control.sublime-package/package_control/download_manager.py", line 24, in <module>
File "<frozen importlib._bootstrap>", line 1565, in _find_and_load
File "<frozen importlib._bootstrap>", line 1532, in _find_and_load_unlocked
File "/opt/sublime_text/Lib/python33/sublime_plugin.py", line 1692, in load_module
exec(compile(source, source_path, 'exec'), mod.__dict__)
File "/home/mhm/.config/sublime-text/Installed Packages/Package Control.sublime-package/package_control/downloaders/__init__.py", line 20, in <module>
File "<frozen importlib._bootstrap>", line 1565, in _find_and_load
File "<frozen importlib._bootstrap>", line 1532, in _find_and_load_unlocked
File "/opt/sublime_text/Lib/python33/sublime_plugin.py", line 1692, in load_module
exec(compile(source, source_path, 'exec'), mod.__dict__)
File "/home/mhm/.config/sublime-text/Installed Packages/Package Control.sublime-package/package_control/downloaders/oscrypto_downloader.py", line 44, in <module>
File "<frozen importlib._bootstrap>", line 1565, in _find_and_load
File "<frozen importlib._bootstrap>", line 1532, in _find_and_load_unlocked
File "/opt/sublime_text/Lib/python33/sublime_plugin.py", line 1692, in load_module
exec(compile(source, source_path, 'exec'), mod.__dict__)
File "/home/mhm/.config/sublime-text/Installed Packages/Package Control.sublime-package/package_control/deps/oscrypto/tls.py", line 23, in <module>
File "<frozen importlib._bootstrap>", line 1565, in _find_and_load
File "<frozen importlib._bootstrap>", line 1532, in _find_and_load_unlocked
File "/opt/sublime_text/Lib/python33/sublime_plugin.py", line 1692, in load_module
exec(compile(source, source_path, 'exec'), mod.__dict__)
File "/home/mhm/.config/sublime-text/Installed Packages/Package Control.sublime-package/package_control/deps/oscrypto/_openssl/tls.py", line 10, in <module>
File "<frozen importlib._bootstrap>", line 1565, in _find_and_load
File "<frozen importlib._bootstrap>", line 1532, in _find_and_load_unlocked
File "/opt/sublime_text/Lib/python33/sublime_plugin.py", line 1692, in load_module
exec(compile(source, source_path, 'exec'), mod.__dict__)
File "/home/mhm/.config/sublime-text/Installed Packages/Package Control.sublime-package/package_control/deps/oscrypto/_openssl/_libssl.py", line 7, in <module>
File "<frozen importlib._bootstrap>", line 1565, in _find_and_load
File "<frozen importlib._bootstrap>", line 1532, in _find_and_load_unlocked
File "/opt/sublime_text/Lib/python33/sublime_plugin.py", line 1692, in load_module
exec(compile(source, source_path, 'exec'), mod.__dict__)
File "/home/mhm/.config/sublime-text/Installed Packages/Package Control.sublime-package/package_control/deps/oscrypto/_openssl/_libcrypto.py", line 15, in <module>
File "<frozen importlib._bootstrap>", line 1565, in _find_and_load
File "<frozen importlib._bootstrap>", line 1532, in _find_and_load_unlocked
File "/opt/sublime_text/Lib/python33/sublime_plugin.py", line 1692, in load_module
exec(compile(source, source_path, 'exec'), mod.__dict__)
File "/home/mhm/.config/sublime-text/Packages/Package Control/package_control/deps/oscrypto/_openssl/_libcrypto_ctypes.py", line 688, in <module>
raise FFIEngineError('Error initializing ctypes')
Package Control.package_control.deps.oscrypto._ffi.FFIEngineError: Error initializing ctypes
There is functionality in oscrypto to override library paths via a _backend_config dict that seems to be initialized during the use_openssl call, but I failed to see a configuration available to the end user to override this within Package Control.
By creating an override file that corrects the path that oscrypto tries to load libcrypto for, I am able to initialize Package Control again.
--- Installed Packages/Package Control/package_control/deps/oscrypto/_openssl/_libcrypto_ctypes.py 2020-10-02 10:34:52
+++ Packages/Package Control/package_control/deps/oscrypto/_openssl/_libcrypto_ctypes.py 2022-11-28 14:47:20
@@ -23,7 +23,7 @@
libcrypto_path = _backend_config().get('libcrypto_path')
if libcrypto_path is None:
- libcrypto_path = get_library('crypto', 'libcrypto.dylib', '42')
+ libcrypto_path = get_library('crypto.so.1', 'libcrypto.dylib', '42')
if not libcrypto_path:
raise LibraryNotFoundError('The library libcrypto could not be found')
Interestingly other packages that try to import things from the PC library (such as the AutomaticPackageReloader importing as PackageManager) fail to load and raise the exception above, even though both are inside of the 3.3 plugin host and the module is available:
reloading python 3.3 plugin AutomaticPackageReloader33.package_reloader
Traceback (most recent call last):
File "/home/mhm/.config/sublime-text/Installed Packages/Package Control.sublime-package/package_control/deps/oscrypto/_openssl/_libcrypto_ctypes.py", line 305, in <module>
File "./python3.3/ctypes/__init__.py", line 366, in __getattr__
File "./python3.3/ctypes/__init__.py", line 371, in __getitem__
AttributeError: /usr/lib/libcrypto.so.3: undefined symbol: EVP_PKEY_size
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/opt/sublime_text/Lib/python33/sublime_plugin.py", line 308, in reload_plugin
m = importlib.import_module(modulename)
File "./python3.3/importlib/__init__.py", line 90, in import_module
File "<frozen importlib._bootstrap>", line 1584, in _gcd_import
File "<frozen importlib._bootstrap>", line 1565, in _find_and_load
File "<frozen importlib._bootstrap>", line 1532, in _find_and_load_unlocked
File "<frozen importlib._bootstrap>", line 584, in _check_name_wrapper
File "<frozen importlib._bootstrap>", line 1022, in load_module
File "<frozen importlib._bootstrap>", line 1003, in load_module
File "<frozen importlib._bootstrap>", line 560, in module_for_loader_wrapper
File "<frozen importlib._bootstrap>", line 868, in _load_module
File "<frozen importlib._bootstrap>", line 313, in _call_with_frames_removed
File "/home/mhm/.config/sublime-text/Packages/AutomaticPackageReloader33/package_reloader.py", line 1, in <module>
from AutomaticPackageReloader import package_reloader as package_reloader38 # noqa
File "/home/mhm/.config/sublime-text/Packages/AutomaticPackageReloader/package_reloader.py", line 8, in <module>
from .reloader import reload_package
File "/home/mhm/.config/sublime-text/Packages/AutomaticPackageReloader/reloader/__init__.py", line 1, in <module>
from .reloader import reload_package, load_dummy
File "/home/mhm/.config/sublime-text/Packages/AutomaticPackageReloader/reloader/reloader.py", line 13, in <module>
from .resolver import resolve_parents
File "/home/mhm/.config/sublime-text/Packages/AutomaticPackageReloader/reloader/resolver.py", line 2, in <module>
from package_control.package_manager import PackageManager
File "<frozen importlib._bootstrap>", line 1565, in _find_and_load
File "<frozen importlib._bootstrap>", line 1532, in _find_and_load_unlocked
File "/home/mhm/.config/sublime-text/Installed Packages/Package Control.sublime-package/package_control/package_manager.py", line 34, in <module>
File "<frozen importlib._bootstrap>", line 1565, in _find_and_load
File "<frozen importlib._bootstrap>", line 1532, in _find_and_load_unlocked
File "/home/mhm/.config/sublime-text/Installed Packages/Package Control.sublime-package/package_control/downloaders/__init__.py", line 20, in <module>
File "<frozen importlib._bootstrap>", line 1565, in _find_and_load
File "<frozen importlib._bootstrap>", line 1532, in _find_and_load_unlocked
File "/home/mhm/.config/sublime-text/Installed Packages/Package Control.sublime-package/package_control/downloaders/oscrypto_downloader.py", line 44, in <module>
File "<frozen importlib._bootstrap>", line 1565, in _find_and_load
File "<frozen importlib._bootstrap>", line 1532, in _find_and_load_unlocked
File "/home/mhm/.config/sublime-text/Installed Packages/Package Control.sublime-package/package_control/deps/oscrypto/tls.py", line 23, in <module>
File "<frozen importlib._bootstrap>", line 1565, in _find_and_load
File "<frozen importlib._bootstrap>", line 1532, in _find_and_load_unlocked
File "/home/mhm/.config/sublime-text/Installed Packages/Package Control.sublime-package/package_control/deps/oscrypto/_openssl/tls.py", line 10, in <module>
File "<frozen importlib._bootstrap>", line 1565, in _find_and_load
File "<frozen importlib._bootstrap>", line 1532, in _find_and_load_unlocked
File "/home/mhm/.config/sublime-text/Installed Packages/Package Control.sublime-package/package_control/deps/oscrypto/_openssl/_libssl.py", line 7, in <module>
File "<frozen importlib._bootstrap>", line 1565, in _find_and_load
File "<frozen importlib._bootstrap>", line 1532, in _find_and_load_unlocked
File "/home/mhm/.config/sublime-text/Installed Packages/Package Control.sublime-package/package_control/deps/oscrypto/_openssl/_libcrypto.py", line 15, in <module>
File "<frozen importlib._bootstrap>", line 1565, in _find_and_load
File "<frozen importlib._bootstrap>", line 1532, in _find_and_load_unlocked
File "/home/mhm/.config/sublime-text/Installed Packages/Package Control.sublime-package/package_control/deps/oscrypto/_openssl/_libcrypto_ctypes.py", line 688, in <module>
package_control.deps.oscrypto._ffi.FFIEngineError: Error initializing ctypes
>>> import sys
>>> {k: v for k, v in sys.modules.items() if "libcrypto" in k}
{}
Python 3.3>>> import sys
Python 3.3>>> {k: v for k, v in sys.modules.items() if "libcrypto" in k}
{'Package Control.package_control.deps.oscrypto._openssl._libcrypto_ctypes': <module 'Package Control.package_control.deps.oscrypto._openssl._libcrypto_ctypes' from '/home/mhm/.config/sublime-text/Packages/Package Control/package_control/deps/oscrypto/_openssl/_libcrypto_ctypes.py'>, 'Package Control.package_control.deps.oscrypto._openssl._libcrypto': <module 'Package Control.package_control.deps.oscrypto._openssl._libcrypto' from '/home/mhm/.config/sublime-text/Installed Packages/Package Control.sublime-package/package_control/deps/oscrypto/_openssl/_libcrypto.py'>}
I'd be curious whether it stil happens in four-point-oh branch as it ships with latest oscrypto libs.
I can try that out some time later if I don't forget. Is there anything else I need to consider before just cloning the repo into my Packages folder?
Basically not, I hope. I've tested migration from PC3.x to PC4 several times with success on Windows and Linux (Elementary OS). It should convert the library structure (move all to Lib) and should be ready after a single restart of ST.
The only limitation so far is libraries being reinstalled rather than updated when calling Satisfy Libraries as required PEP404 and PEP508 version comparison is not yet applied.
I use that branch in production without noticible issues however.
Quick update, since my local setup became so broken I needed to update my packages and wasn't able to go around this anymore. Following are my steps and observations during the update process:
- Close ST.
- Removed Package Control from Installed Packages and clone into Packages (
masterbranch!). - Start ST, packages are updated (=> the problem appears to be fixed in
masteralready) - Close ST.
- Checkout
four-point-ohbranch. - Start ST, wait for the PC popup asking me to restart, close ST.
- Start ST, wait for the PC popup asking me to restart, close ST.
- Start ST, no popup anymore and also almost no tracebacks in the console anymore except for this one:
Traceback (most recent call last):
File "/opt/sublime_text/Lib/python33/sublime_plugin.py", line 528, in on_api_ready
plc()
File "/home/fichte/.config/sublime-text/Installed Packages/SublimeLinter.sublime-package/sublime_linter.py", line 54, in plugin_loaded
package_control.events.install('SublimeLinter') or
AttributeError: 'module' object has no attribute 'events'
~~There should probably be a fake module for compatibility after the update here.~~
~~There seems to be one already but not sure why SL doesn't have it.~~
SL doesn't import package_control.events. Raising upstream.
https://github.com/SublimeLinter/SublimeLinter/pull/1889
>>> import package_control
>>> import package_control.events
>>> package_control.events
<module 'package_control.events' from '/home/fichte/.config/sublime-text/Packages/Package Control/package_control/events.py'>
>>> package_control.events.install
<function install at 0x7fa533e19ee0>
Python 3.3>>> import package_control
Python 3.3>>> import package_control.events
Python 3.3>>> package_control.events.install
<function install at 0x7f60cdf43b00>
The solution put forth by @faelin worked for me. I ended up running the following:
ln -sf /usr/local/Cellar/[email protected]/1.1.1u/lib/libcrypto.dylib /usr/local/lib/
@faelin Thank you!!
On my Mac, with Ventura, the path was slightly different (1.1.1u -> 1.1.1k). Running ln -sf /usr/local/Cellar/[email protected]/1.1.1k/lib/libcrypto.dylib /usr/local/lib/ solved the problem.
PS: the problem occurred after the installation of BeautifyLatex with LatexIndent.
For those who having trouble due to OpenSSL and some time for testing could checkout PC 4.0-beta.
To do so:
-
create a backup of your ST profile including all packages in case you want or need to roll back!
-
Open Command Palette and call Preferences: Package Control Settings
-
add "Package Control" to the list of
"install_prereleases"as followed:"install_prereleases": [ "Package Control", ], -
Open Command Palette and call Package Control: Update Package
-
Select "Package Control" and hit enter
Package Control 4.0 uses latest oscrypto library which should support OpenSSL 3.
Warning
Make a backup of your data!
PC4.0 converts dependencies to libraries and installs them to "Data\Lib\python3.x" folder.
The solution put forth by @faelin worked for me. I ended up running the following:
ln -sf /usr/local/Cellar/[email protected]/1.1.1u/lib/libcrypto.dylib /usr/local/lib/@faelin Thank you!!
This is a bad idea as it will break anything that expects the default library to be OpenSSL 3.
"install_prereleases": [ "Package Control", ],
Is there any way to bootstrap this?
Package Control will be uppraded next time package update is triggered, either by automatic updates at ST startup or by manually calling "Package Control: Upgrade All Packages/Overwrite All" via Command Palette.
In case PC3.x is not working, you can
- download https://github.com/wbond/package_control/releases/download/4.0.0-beta8/Package.Control.sublime-package
- call Main Menu > Preferences > Browse Packages...
- navigate to to ../Installed Packages
- move downloaded package into Installed Packages and rename it to Package Control.sublime-package (replace the
.by).
@deathaxe The file that gets downloaded in your instructions above is named 'Package.Control.sublime-package'
I found that I needed to rename the file to 'Package Control.sublime-package' in order for this fix to work. (I changed the first Period, after the word 'Package' to a space)
Also needed to restart ST3.
Package Control appears to be working again as expected after this.
Package Control will be uppraded next time package update is triggered, either by automatic updates at ST startup or by manually calling "Package Control: Upgrade All Packages/Overwrite All" via Command Palette.
In case PC3.x is not working, you can
1. download https://github.com/wbond/package_control/releases/download/4.0.0-beta2/Package.Control.sublime-package 2. call _Main Menu > Preferences > Browse Packages..._ 3. navigate to to _../Installed Packages_ 4. move _Package Control.sublime-package_ to ST's _Installed Packages_
Right, but that only works if PC has been installed and bootstrapped. On a clean install these steps don't work.
@brian-farrell That's unfortunatelly a restriction of GitHub download artefacts, that whitespace is automatically replaced by period.
Forgot about that.
@inferiorhumanorgans Package Control bootstraps itself. There's nothing more to do, than placing it into Installed Packages. Maybe a restart is needed after it was loaded the first time. but that's it. Please check file name. The download artefact contains an unwanted period.
My unit tests for osx have started failing. I assume it's related to this issue. It times out when trying to install Package Control:
...
/Users/runner/work/NeoVintageous/NeoVintageous
Run . $GITHUB_ACTION_PATH/../../scripts/utils.sh
copy the package to sublime package directory
/Users/runner/work/NeoVintageous/NeoVintageous
Installing UnitTesting from https://github.com/SublimeText/[email protected] to /Users/runner/Library/Application Support/Sublime Text/Packages/UnitTesting
Installing coverage from https://github.com/codexns/[email protected] to /Users/runner/Library/Application Support/Sublime Text/Packages/coverage
Run bash $GITHUB_ACTION_PATH/../../scripts/install_package_control.sh
creating Package Control.sublime-settings
/Users/runner/work/_actions/SublimeText/UnitTesting/v1/actions/setup/../../scripts/install_package_control.sh: line 67: 1293 Terminated: 15 subl
/Users/runner/work/_actions/SublimeText/UnitTesting/v1/actions/setup/../../scripts/install_package_control.sh: line 67: 1873 Terminated: 15 subl
/Users/runner/work/_actions/SublimeText/UnitTesting/v1/actions/setup/../../scripts/install_package_control.sh: line 67: 2060 Terminated: 15 subl
....................................Timeout: Fail to install Package Control.
Error: Process completed with exit code 1.
https://github.com/NeoVintageous/NeoVintageous/actions/runs/5601698773
Is there anything I need to do or will fixed upstream in time?
It would require PC4.0 to be released and the sublime-package file being uploaded to packagecontrol.io or Unittest to be tweaked to use PC4.0 beta builds. Whatever happens first (or ever).
Package Control will be uppraded next time package update is triggered, either by automatic updates at ST startup or by manually calling "Package Control: Upgrade All Packages/Overwrite All" via Command Palette.
In case PC3.x is not working, you can
1. download https://github.com/wbond/package_control/releases/download/4.0.0-beta2/Package.Control.sublime-package 2. call _Main Menu > Preferences > Browse Packages..._ 3. navigate to to _../Installed Packages_ 4. move downloaded package into _Installed Packages_ and rename it to _Package Control.sublime-package_ (replace the `.` by ` `).
Thanks, this worked for me on Ventura 13.4 after a clean install of ST4. Moving the file to "Installed Packages" made the difference. There's another thread on Github saying it should be placed in "Packages", but that didn't do the trick.