OpenSSL / libcrypto.dylib Problem with Package Control in Sublime Text 3 - sublimetext3

Package Control is not loading in Sublime Text 3 running on MacOS, Catalina 10.15.6.
None of the Package Control commands are shown in the Command Palette.
I have checked that Package Control was not in ignored_packages, have manually reinstalled Package Control (multiple times), and even uninstalled and reinstalled Sublime Text 3.
When I start Sublime Text 3 the error below is shown in the console when it tries to load Package Control. It looks like the problem relates in some way to OpenSSL, specifically to the libcrypto.dylib file.
I recently updated/upgraded my system using Homebrew and suspect that something occurred during the update that has caused the problem.
reloading plugin Package Control.Package Control
Traceback (most recent call last):
File "/Applications/Sublime Text.app/Contents/MacOS/sublime_plugin.py", line 125, 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/sublime_plugin.py", line 1199, in load_module
exec(compile(source, source_path, 'exec'), mod.__dict__)
File "/Users/bader/Library/Application Support/Sublime Text 3/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/sublime_plugin.py", line 1199, in load_module
exec(compile(source, source_path, 'exec'), mod.__dict__)
File "/Users/bader/Library/Application Support/Sublime Text 3/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/sublime_plugin.py", line 1199, in load_module
exec(compile(source, source_path, 'exec'), mod.__dict__)
File "/Users/bader/Library/Application Support/Sublime Text 3/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/sublime_plugin.py", line 1199, in load_module
exec(compile(source, source_path, 'exec'), mod.__dict__)
File "/Users/bader/Library/Application Support/Sublime Text 3/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/sublime_plugin.py", line 1199, in load_module
exec(compile(source, source_path, 'exec'), mod.__dict__)
File "/Users/bader/Library/Application Support/Sublime Text 3/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/sublime_plugin.py", line 1199, in load_module
exec(compile(source, source_path, 'exec'), mod.__dict__)
File "/Users/bader/Library/Application Support/Sublime Text 3/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/sublime_plugin.py", line 1199, in load_module
exec(compile(source, source_path, 'exec'), mod.__dict__)
File "/Users/bader/Library/Application Support/Sublime Text 3/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/sublime_plugin.py", line 1199, in load_module
exec(compile(source, source_path, 'exec'), mod.__dict__)
File "/Users/bader/Library/Application Support/Sublime Text 3/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/sublime_plugin.py", line 1199, in load_module
exec(compile(source, source_path, 'exec'), mod.__dict__)
File "/Users/bader/Library/Application Support/Sublime Text 3/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/sublime_plugin.py", line 1199, in load_module
exec(compile(source, source_path, 'exec'), mod.__dict__)
File "/Users/bader/Library/Application Support/Sublime Text 3/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/sublime_plugin.py", line 1199, in load_module
exec(compile(source, source_path, 'exec'), mod.__dict__)
File "/Users/bader/Library/Application Support/Sublime Text 3/Installed Packages/Package Control.sublime-package/package_control/deps/oscrypto/_openssl/_libcrypto_ctypes.py", line 30, in <module>
File "./python3.3/ctypes/__init__.py", line 353, in __init__
OSError: dlopen(/usr/local/lib/libcrypto.dylib, 6): no suitable image found. Did find:
/usr/local/lib/libcrypto.dylib: mach-o, but wrong architecture
/usr/local/lib/libcrypto.dylib: mach-o, but wrong architecture

#MattDMo, you were correct that it was a 32-bit versus 64-bit problem AND that Will Bond would help. After posting a ticket on Package Control, #wbond responded right away suggesting that I move the file /usr/local/lib/libcrypto.dylib.
For the sake of completeness, #wbond asked for the output of the terminal command:
file /usr/local/lib/libcrypto.dylib
That returned
/usr/local/lib/libcrypto.dylib: Mach-O dynamically linked shared library i386
And he wrote:
Hmm, I don't think there is a 32bit version of macOS 11. I'd move that file and restart Sublime Text.
He was correct and it worked.

Related

Can not install requests in Ubuntu 16.04, says, module 'os' has no attribute 'PathLike'

I have been trying to install the requests module in Ubuntu 16.04 and followed a lot of suggestions available here, but in vain. pip3 is already installed on my machine. The python versions in my machines are 2.7 and 3.5. When I am running the command "pip3 install requests", I am getting the following output:
Traceback (most recent call last):
File "/usr/lib/python3/dist-packages/pip/_vendor/__init__.py", line 33, in vendored
__import__(vendored_name, globals(), locals(), level=0)
ImportError: No module named 'pip._vendor.cachecontrol'
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/home/pa/.local/lib/python3.5/site-packages/certifi/core.py", line 12, in
<module>
from importlib.resources import path as get_path, read_text
ImportError: No module named 'importlib.resources'
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/usr/bin/pip3", line 9, in <module>
from pip import main
File "/usr/lib/python3/dist-packages/pip/__init__.py", line 13, in <module>
from pip.exceptions import InstallationError, CommandError, PipError
File "/usr/lib/python3/dist-packages/pip/exceptions.py", line 6, in <module>
from pip._vendor.six import iteritems
File "/usr/lib/python3/dist-packages/pip/_vendor/__init__.py", line 64, in <module>
vendored("cachecontrol")
File "/usr/lib/python3/dist-packages/pip/_vendor/__init__.py", line 36, in vendored
__import__(modulename, globals(), locals(), level=0)
File "<frozen importlib._bootstrap>", line 969, in _find_and_load
File "<frozen importlib._bootstrap>", line 958, in _find_and_load_unlocked
File "<frozen importlib._bootstrap>", line 664, in _load_unlocked
File "<frozen importlib._bootstrap>", line 634, in _load_backward_compatible
File "/usr/share/python-wheels/CacheControl-0.11.5-py2.py3-none-
any.whl/cachecontrol/__init__.py", line 9, in <module>
File "<frozen importlib._bootstrap>", line 969, in _find_and_load
File "<frozen importlib._bootstrap>", line 958, in _find_and_load_unlocked
File "<frozen importlib._bootstrap>", line 664, in _load_unlocked
File "<frozen importlib._bootstrap>", line 634, in _load_backward_compatible
File "/usr/share/python-wheels/CacheControl-0.11.5-py2.py3-none-
any.whl/cachecontrol/wrapper.py", line 1, in <module>
File "<frozen importlib._bootstrap>", line 969, in _find_and_load
File "<frozen importlib._bootstrap>", line 958, in _find_and_load_unlocked
File "<frozen importlib._bootstrap>", line 664, in _load_unlocked
File "<frozen importlib._bootstrap>", line 634, in _load_backward_compatible
File "/usr/share/python-wheels/CacheControl-0.11.5-py2.py3-none-
any.whl/cachecontrol/adapter.py", line 3, in <module>
File "<frozen importlib._bootstrap>", line 969, in _find_and_load
File "<frozen importlib._bootstrap>", line 958, in _find_and_load_unlocked
File "<frozen importlib._bootstrap>", line 664, in _load_unlocked
File "<frozen importlib._bootstrap>", line 634, in _load_backward_compatible
File "/usr/share/python-wheels/requests-2.9.1-py2.py3-none-
any.whl/requests/__init__.py", line 58, in <module>
File "<frozen importlib._bootstrap>", line 969, in _find_and_load
File "<frozen importlib._bootstrap>", line 958, in _find_and_load_unlocked
File "<frozen importlib._bootstrap>", line 664, in _load_unlocked
File "<frozen importlib._bootstrap>", line 634, in _load_backward_compatible
File "/usr/share/python-wheels/requests-2.9.1-py2.py3-none-
any.whl/requests/utils.py", line 25, in <module>
File "<frozen importlib._bootstrap>", line 969, in _find_and_load
File "<frozen importlib._bootstrap>", line 958, in _find_and_load_unlocked
File "<frozen importlib._bootstrap>", line 664, in _load_unlocked
File "<frozen importlib._bootstrap>", line 634, in _load_backward_compatible
File "/usr/share/python-wheels/requests-2.9.1-py2.py3-none-
any.whl/requests/certs.py", line 17, in <module>
File "/home/pa/.local/lib/python3.5/site-packages/certifi/__init__.py", line 1, in
<module>
from .core import contents, where
File "/home/pa/.local/lib/python3.5/site-packages/certifi/core.py", line 44, in
<module>
Resource = Union[str, "os.PathLike"]
File "/usr/lib/python3.5/typing.py", line 552, in __getitem__
dict(self.__dict__), parameters, _root=True)
File "/usr/lib/python3.5/typing.py", line 512, in __new__
for t2 in all_params - {t1} if not isinstance(t2, TypeVar)):
File "/usr/lib/python3.5/typing.py", line 512, in <genexpr>
for t2 in all_params - {t1} if not isinstance(t2, TypeVar)):
File "/usr/lib/python3.5/typing.py", line 190, in __subclasscheck__
self._eval_type(globalns, localns)
File "/usr/lib/python3.5/typing.py", line 177, in _eval_type
eval(self.__forward_code__, globalns, localns),
File "<string>", line 1, in <module>
AttributeError: module 'os' has no attribute 'PathLike'
I tried it via Pycharm also, but couldn't do it. Is there any alternative way? Any kind of help would be appreciated?

pyinstaller FileNotFoundError: [Errno2] cannot file /tmp/_MEI****/include/ufc.h

I am using pyinstaller (5.3) and python(3.10) to convert a sample .py file to an executable in linux. I have tested this package for several simple programs which does not involve the package 'dolfin'. However, even if I have a simple program which involves the dolfin module, the executable fails.
Here is the findvec.py file
from dolfin import BoxMesh, Point
mesh = BoxMesh(Point(0,0,0),Point(1,1,1),2,2,2)
x = mesh.coordinates()[:,0]
for i in range(len(x)):
print('Pos',i+1,'Val = ',x[i])
When i use this command
pyinstaller --onefile findvec.py, the executable is generated fine, however upon execution the following error pop out. Any ideas what these errors refer to, and how to possibly combat this issue?
Traceback (most recent call last):
File "findvec.py", line 2, in <module>
File "<frozen importlib._bootstrap>", line 1027, in _find_and_load
File "<frozen importlib._bootstrap>", line 1006, in _find_and_load_unlocked
File "<frozen importlib._bootstrap>", line 688, in _load_unlocked
File "PyInstaller/loader/pyimod02_importers.py", line 493, in exec_module
File "fenics/__init__.py", line 7, in <module>
File "<frozen importlib._bootstrap>", line 1027, in _find_and_load
File "<frozen importlib._bootstrap>", line 1006, in _find_and_load_unlocked
File "<frozen importlib._bootstrap>", line 688, in _load_unlocked
File "PyInstaller/loader/pyimod02_importers.py", line 493, in exec_module
File "dolfin/__init__.py", line 136, in <module>
File "<frozen importlib._bootstrap>", line 1027, in _find_and_load
File "<frozen importlib._bootstrap>", line 1006, in _find_and_load_unlocked
File "<frozen importlib._bootstrap>", line 688, in _load_unlocked
File "PyInstaller/loader/pyimod02_importers.py", line 493, in exec_module
File "dolfin/parameter/__init__.py", line 11, in <module>
File "<frozen importlib._bootstrap>", line 1027, in _find_and_load
File "<frozen importlib._bootstrap>", line 1006, in _find_and_load_unlocked
File "<frozen importlib._bootstrap>", line 688, in _load_unlocked
File "PyInstaller/loader/pyimod02_importers.py", line 493, in exec_module
File "ffc/__init__.py", line 24, in <module>
File "<frozen importlib._bootstrap>", line 1027, in _find_and_load
File "<frozen importlib._bootstrap>", line 1006, in _find_and_load_unlocked
File "<frozen importlib._bootstrap>", line 688, in _load_unlocked
File "PyInstaller/loader/pyimod02_importers.py", line 493, in exec_module
File "ffc/compiler.py", line 129, in <module>
File "<frozen importlib._bootstrap>", line 1027, in _find_and_load
File "<frozen importlib._bootstrap>", line 1006, in _find_and_load_unlocked
File "<frozen importlib._bootstrap>", line 688, in _load_unlocked
File "PyInstaller/loader/pyimod02_importers.py", line 493, in exec_module
File "ffc/codegeneration.py", line 40, in <module>
File "<frozen importlib._bootstrap>", line 1027, in _find_and_load
File "<frozen importlib._bootstrap>", line 1006, in _find_and_load_unlocked
File "<frozen importlib._bootstrap>", line 688, in _load_unlocked
File "PyInstaller/loader/pyimod02_importers.py", line 493, in exec_module
File "ffc/uflacs/backends/ufc/generators.py", line 19, in <module>
File "<frozen importlib._bootstrap>", line 1027, in _find_and_load
File "<frozen importlib._bootstrap>", line 1006, in _find_and_load_unlocked
File "<frozen importlib._bootstrap>", line 688, in _load_unlocked
File "PyInstaller/loader/pyimod02_importers.py", line 493, in exec_module
File "ffc/uflacs/backends/ufc/finite_element.py", line 29, in <module>
File "<frozen importlib._bootstrap>", line 1027, in _find_and_load
File "<frozen importlib._bootstrap>", line 1006, in _find_and_load_unlocked
File "<frozen importlib._bootstrap>", line 688, in _load_unlocked
File "PyInstaller/loader/pyimod02_importers.py", line 493, in exec_module
File "ffc/uflacs/backends/ufc/generator.py", line 22, in <module>
File "<frozen importlib._bootstrap>", line 1027, in _find_and_load
File "<frozen importlib._bootstrap>", line 1006, in _find_and_load_unlocked
File "<frozen importlib._bootstrap>", line 688, in _load_unlocked
File "PyInstaller/loader/pyimod02_importers.py", line 493, in exec_module
File "ffc/backends/ufc/__init__.py", line 172, in <module>
File "ffc/backends/ufc/__init__.py", line 165, in _compute_ufc_signature
FileNotFoundError: [Errno 2] No such file or directory: '/tmp/_MEIsa44Nd/include/ufc.h'
[153489] Failed to execute script 'findvec' due to unhandled exception!
I have seen quite a few answers related to this problem, however it refers to a keyword _MEIPASS which is temporarily created upon executing. In my case I can see a tmp file created with /tmp/MEI******/ where the asterisks represent randomly alphabets each time i execute it. I cannot possibly track what causes this issue, when I know for sure that the file 'ufc.h' was present during the generation of the distribution using pyinstaller initially.

Django or python version issue: ModuleNotFoundError: No module named 'database'

when i try to start my Django project i get this error which i am unable to solve:
ModuleNotFoundError: No module named 'database'
The error stack:
Traceback (most recent call last):
File "/home/olw/candidatis/database-rest/venv/lib/python3.10/site-packages/django/core/management/base.py", line 414, in run_from_argv
self.execute(*args, **cmd_options)
File "/home/olw/candidatis/database-rest/venv/lib/python3.10/site-packages/django/core/management/base.py", line 455, in execute
self.check()
File "/home/olw/candidatis/database-rest/venv/lib/python3.10/site-packages/django/core/management/base.py", line 487, in check
all_issues = checks.run_checks(
File "/home/olw/candidatis/database-rest/venv/lib/python3.10/site-packages/django/core/checks/registry.py", line 88, in run_checks
new_errors = check(app_configs=app_configs, databases=databases)
File "/home/olw/candidatis/database-rest/venv/lib/python3.10/site-packages/django/core/checks/caches.py", line 17, in check_default_cache_is_configured
if DEFAULT_CACHE_ALIAS not in settings.CACHES:
File "/home/olw/candidatis/database-rest/venv/lib/python3.10/site-packages/django/conf/__init__.py", line 87, in __getattr__
self._setup(name)
File "/home/olw/candidatis/database-rest/venv/lib/python3.10/site-packages/django/conf/__init__.py", line 74, in _setup
self._wrapped = Settings(settings_module)
File "/home/olw/candidatis/database-rest/venv/lib/python3.10/site-packages/django/conf/__init__.py", line 183, in __init__
mod = importlib.import_module(self.SETTINGS_MODULE)
File "/usr/lib/python3.10/importlib/__init__.py", line 126, in import_module
return _bootstrap._gcd_import(name[level:], package, level)
File "<frozen importlib._bootstrap>", line 1050, in _gcd_import
File "<frozen importlib._bootstrap>", line 1027, in _find_and_load
File "<frozen importlib._bootstrap>", line 992, in _find_and_load_unlocked
File "<frozen importlib._bootstrap>", line 241, in _call_with_frames_removed
File "<frozen importlib._bootstrap>", line 1050, in _gcd_import
File "<frozen importlib._bootstrap>", line 1027, in _find_and_load
File "<frozen importlib._bootstrap>", line 1004, in _find_and_load_unlocked
ModuleNotFoundError: No module named 'database'
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/home/olw/candidatis/database-rest/manage.py", line 22, in <module>
main()
File "/home/olw/candidatis/database-rest/manage.py", line 18, in main
execute_from_command_line(sys.argv)
File "/home/olw/candidatis/database-rest/venv/lib/python3.10/site-packages/django/core/management/__init__.py", line 446, in execute_from_command_line
utility.execute()
File "/home/olw/candidatis/database-rest/venv/lib/python3.10/site-packages/django/core/management/__init__.py", line 440, in execute
self.fetch_command(subcommand).run_from_argv(self.argv)
File "/home/olw/candidatis/database-rest/venv/lib/python3.10/site-packages/django/core/management/base.py", line 427, in run_from_argv
connections.close_all()
File "/home/olw/candidatis/database-rest/venv/lib/python3.10/site-packages/django/db/utils.py", line 212, in close_all
for alias in self:
File "/home/olw/candidatis/database-rest/venv/lib/python3.10/site-packages/django/utils/connection.py", line 73, in __iter__
return iter(self.settings)
File "/home/olw/candidatis/database-rest/venv/lib/python3.10/site-packages/django/utils/functional.py", line 49, in __get__
res = instance.__dict__[self.name] = self.func(instance)
File "/home/olw/candidatis/database-rest/venv/lib/python3.10/site-packages/django/utils/connection.py", line 45, in settings
self._settings = self.configure_settings(self._settings)
File "/home/olw/candidatis/database-rest/venv/lib/python3.10/site-packages/django/db/utils.py", line 148, in configure_settings
databases = super().configure_settings(databases)
File "/home/olw/candidatis/database-rest/venv/lib/python3.10/site-packages/django/utils/connection.py", line 50, in configure_settings
settings = getattr(django_settings, self.settings_name)
File "/home/olw/candidatis/database-rest/venv/lib/python3.10/site-packages/django/conf/__init__.py", line 87, in __getattr__
self._setup(name)
File "/home/olw/candidatis/database-rest/venv/lib/python3.10/site-packages/django/conf/__init__.py", line 74, in _setup
self._wrapped = Settings(settings_module)
File "/home/olw/candidatis/database-rest/venv/lib/python3.10/site-packages/django/conf/__init__.py", line 183, in __init__
mod = importlib.import_module(self.SETTINGS_MODULE)
File "/usr/lib/python3.10/importlib/__init__.py", line 126, in import_module
return _bootstrap._gcd_import(name[level:], package, level)
File "<frozen importlib._bootstrap>", line 1050, in _gcd_import
File "<frozen importlib._bootstrap>", line 1027, in _find_and_load
File "<frozen importlib._bootstrap>", line 992, in _find_and_load_unlocked
File "<frozen importlib._bootstrap>", line 241, in _call_with_frames_removed
File "<frozen importlib._bootstrap>", line 1050, in _gcd_import
File "<frozen importlib._bootstrap>", line 1027, in _find_and_load
File "<frozen importlib._bootstrap>", line 1004, in _find_and_load_unlocked
ModuleNotFoundError: No module named 'database'
I already tried to install the databases package (This is the recommended answer you almost find anywhere)
Trying to make sense out of the stack trace it seems that python itself cannot import this module (So there is no issue in my code or something...).
My installed packages:
The python version i am using is Python 3.10.5
Anybody any idea ?
UPDATE APPS LIST
Here is my installed apps list ->
INSTALLED_APPS = [
"django.contrib.admin",
"django.contrib.auth",
"django.contrib.contenttypes",
"django.contrib.sessions",
"django.contrib.messages",
"django.contrib.staticfiles",
"django.contrib.admindocs.urls",
"rest",
"rest_framework",
"custom_db_logger",
]

Why does QtConsole error out when I try to convert it to bundle in pyinstaller?

My qtconsole code is this:
import sys
from qtpy import QtWidgets
from qtconsole.rich_jupyter_widget import RichJupyterWidget
from qtconsole.manager import QtKernelManager
# The ID of an installed kernel, e.g. 'bash' or 'ir'.
USE_KERNEL = 'python3'
def make_jupyter_widget_with_kernel():
"""Start a kernel, connect to it, and create a RichJupyterWidget to use it
"""
kernel_manager = QtKernelManager(kernel_name=USE_KERNEL)
kernel_manager.start_kernel()
kernel_client = kernel_manager.client()
kernel_client.start_channels()
jupyter_widget = RichJupyterWidget()
jupyter_widget.kernel_manager = kernel_manager
jupyter_widget.kernel_client = kernel_client
return jupyter_widget
class MainWindow(QtWidgets.QMainWindow):
"""A window that contains a single Qt console."""
def __init__(self):
super().__init__()
self.jupyter_widget = make_jupyter_widget_with_kernel()
self.setCentralWidget(self.jupyter_widget)
def shutdown_kernel(self):
print('Shutting down kernel...')
self.jupyter_widget.kernel_client.stop_channels()
self.jupyter_widget.kernel_manager.shutdown_kernel()
if __name__ == "__main__":
app = QtWidgets.QApplication(sys.argv)
window = MainWindow()
window.show()
app.aboutToQuit.connect(window.shutdown_kernel)
sys.exit(app.exec_())
it successfully compiles when I run it but when I click on the finished pyinstaller (pyinstaller --onefile main.py or pyinstaller --windowed --onedir Yuro.py) bundle, this qtconsole errors out with message:
File "main.py", line 38, in <module>
File "main.py", line 28, in __init__
File "main.py", line 14, in make_jupyter_widget_with_kernel
File "jupyter_client/utils.py", line 26, in wrapped
File "jupyter_client/utils.py", line 23, in wrapped
File "nest_asyncio.py", line 70, in run_until_complete
File "asyncio/futures.py", line 201, in result
File "asyncio/tasks.py", line 256, in __step
File "jupyter_client/manager.py", line 362, in _async_start_kernel
File "jupyter_client/manager.py", line 347, in _async_start_kernel
File "jupyter_client/utils.py", line 26, in wrapped
File "jupyter_client/utils.py", line 23, in wrapped
File "nest_asyncio.py", line 70, in run_until_complete
File "asyncio/futures.py", line 201, in result
File "asyncio/tasks.py", line 256, in __step
File "jupyter_client/manager.py", line 308, in _async_pre_start_kernel
File "jupyter_client/manager.py", line 138, in kernel_spec
File "jupyter_client/kernelspec.py", line 294, in get_kernel_spec
File "jupyter_client/kernelspec.py", line 247, in _get_kernel_spec_by_name
File "<frozen importlib._bootstrap>", line 1007, in _find_and_load
File "<frozen importlib._bootstrap>", line 986, in _find_and_load_unlocked
File "<frozen importlib._bootstrap>", line 680, in _load_unlocked
File "PyInstaller/loader/pyimod03_importers.py", line 495, in exec_module
File "ipykernel/kernelspec.py", line 16, in <module>
File "<frozen importlib._bootstrap>", line 1007, in _find_and_load
File "<frozen importlib._bootstrap>", line 986, in _find_and_load_unlocked
File "<frozen importlib._bootstrap>", line 680, in _load_unlocked
File "PyInstaller/loader/pyimod03_importers.py", line 495, in exec_module
File "ipykernel/ipkernel.py", line 38, in <module>
File "<frozen importlib._bootstrap>", line 1007, in _find_and_load
File "<frozen importlib._bootstrap>", line 986, in _find_and_load_unlocked
File "<frozen importlib._bootstrap>", line 680, in _load_unlocked
File "PyInstaller/loader/pyimod03_importers.py", line 495, in exec_module
File "ipykernel/debugger.py", line 20, in <module>
File "<frozen importlib._bootstrap>", line 1007, in _find_and_load
File "<frozen importlib._bootstrap>", line 986, in _find_and_load_unlocked
File "<frozen importlib._bootstrap>", line 680, in _load_unlocked
File "PyInstaller/loader/pyimod03_importers.py", line 495, in exec_module
File "debugpy/server/__init__.py", line 9, in <module>
File "<frozen importlib._bootstrap>", line 1007, in _find_and_load
File "<frozen importlib._bootstrap>", line 986, in _find_and_load_unlocked
File "<frozen importlib._bootstrap>", line 680, in _load_unlocked
File "PyInstaller/loader/pyimod03_importers.py", line 495, in exec_module
File "debugpy/_vendored/__init__.py", line 18, in <module>
FileNotFoundError: [Errno 2] No such file or directory: '/var/folders/2n/h8v95wf976v7byjf7s78jfxh0000gn/T/_MEIu7ujzo/debugpy/_vendored'
I took this qtconsole code from the qtconsole github: "https://github.com/jupyter/qtconsole/blob/master/examples/embed_qtconsole.py." Thank you in advance for your help.

'Python manage.py runserver' "ValueError: Unable to configure handler 'mail_admins'".:

I'm working on a Django project.
When starting the server I get "ValueError: Unable to configure handler 'mail_admins'".
I'm in the correct directory, with virtual environment started.
I can't make migrations, same error apears.
Everything was working fine was able to start the server on this method in the past with no problem, until today.
Thanks in advance!
Version:
Windows 10
Python 3.8.1
Django==3.1.5
frego#Yisus-Robles MINGW64 ~/Desktop/news
$ python manage.py runserver
Traceback (most recent call last):
File "c:\users\frego\appdata\local\programs\python\python38\lib\logging\config.py", line 563, in configure
handler = self.configure_handler(handlers[name])
File "c:\users\frego\appdata\local\programs\python\python38\lib\logging\config.py", line 744, in configure_handler
result = factory(**kwargs)
File "C:\Users\frego\.virtualenvs\frego-6ij68a4f\lib\site-packages\django\utils\log.py", line 89, in __init__
self.reporter_class = import_string(reporter_class or settings.DEFAULT_EXCEPTION_REPORTER)
File "C:\Users\frego\.virtualenvs\frego-6ij68a4f\lib\site-packages\django\utils\module_loading.py", line 17, in import_string
module = import_module(module_path)
File "c:\users\frego\appdata\local\programs\python\python38\lib\importlib\__init__.py", line 127, in import_module
return _bootstrap._gcd_import(name[level:], package, level)
File "<frozen importlib._bootstrap>", line 1014, in _gcd_import
File "<frozen importlib._bootstrap>", line 991, in _find_and_load
File "<frozen importlib._bootstrap>", line 961, in _find_and_load_unlocked
File "<frozen importlib._bootstrap>", line 219, in _call_with_frames_removed
File "<frozen importlib._bootstrap>", line 1014, in _gcd_import
File "<frozen importlib._bootstrap>", line 991, in _find_and_load
File "<frozen importlib._bootstrap>", line 975, in _find_and_load_unlocked
File "<frozen importlib._bootstrap>", line 671, in _load_unlocked
File "<frozen importlib._bootstrap_external>", line 783, in exec_module
File "<frozen importlib._bootstrap>", line 219, in _call_with_frames_removed
File "C:\Users\frego\.virtualenvs\frego-6ij68a4f\lib\site-packages\django\views\__init__.py", line 1, in <module>
from django.views.generic.base import View
File "<frozen importlib._bootstrap>", line 991, in _find_and_load
File "<frozen importlib._bootstrap>", line 971, in _find_and_load_unlocked
File "<frozen importlib._bootstrap>", line 914, in _find_spec
File "<frozen importlib._bootstrap_external>", line 1342, in find_spec
File "<frozen importlib._bootstrap_external>", line 1314, in _get_spec
File "<frozen importlib._bootstrap_external>", line 1443, in find_spec
File "<frozen importlib._bootstrap_external>", line 1483, in _fill_cache
OSError: [WinError 1392] El archivo o directorio est▒ da▒ado o es ilegible: 'C:\\Users\\frego\\.virtualenvs\\frego-6ij68a4f\\lib\\site-packages\\django\\views\\generic'
The above exception was the direct cause of the following exception:
Traceback (most recent call last):
File "C:\Users\frego\.virtualenvs\frego-6ij68a4f\lib\site-packages\django\core\management\__init__.py", line 357, in execute
autoreload.check_errors(django.setup)()
File "C:\Users\frego\.virtualenvs\frego-6ij68a4f\lib\site-packages\django\utils\autoreload.py", line 53, in wrapper
fn(*args, **kwargs)
File "C:\Users\frego\.virtualenvs\frego-6ij68a4f\lib\site-packages\django\__init__.py", line 19, in setup
configure_logging(settings.LOGGING_CONFIG, settings.LOGGING)
File "C:\Users\frego\.virtualenvs\frego-6ij68a4f\lib\site-packages\django\utils\log.py", line 71, in configure_logging
logging.config.dictConfig(DEFAULT_LOGGING)
File "c:\users\frego\appdata\local\programs\python\python38\lib\logging\config.py", line 808, in dictConfig
dictConfigClass(config).configure()
File "c:\users\frego\appdata\local\programs\python\python38\lib\logging\config.py", line 570, in configure
raise ValueError('Unable to configure handler '
ValueError: Unable to configure handler 'mail_admins'
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "manage.py", line 22, in <module>
main()
File "manage.py", line 18, in main
execute_from_command_line(sys.argv)
File "C:\Users\frego\.virtualenvs\frego-6ij68a4f\lib\site-packages\django\core\management\__init__.py", line 401, in execute_from_command_line
utility.execute()
File "C:\Users\frego\.virtualenvs\frego-6ij68a4f\lib\site-packages\django\core\management\__init__.py", line 370, in execute
_parser = self.fetch_command('runserver').create_parser('django', 'runserver')
File "C:\Users\frego\.virtualenvs\frego-6ij68a4f\lib\site-packages\django\core\management\__init__.py", line 244, in fetch_command
klass = load_command_class(app_name, subcommand)
File "C:\Users\frego\.virtualenvs\frego-6ij68a4f\lib\site-packages\django\core\management\__init__.py", line 37, in load_command_class
module = import_module('%s.management.commands.%s' % (app_name, name))
File "c:\users\frego\appdata\local\programs\python\python38\lib\importlib\__init__.py", line 127, in import_module
return _bootstrap._gcd_import(name[level:], package, level)
File "<frozen importlib._bootstrap>", line 1014, in _gcd_import
File "<frozen importlib._bootstrap>", line 991, in _find_and_load
File "<frozen importlib._bootstrap>", line 975, in _find_and_load_unlocked
File "<frozen importlib._bootstrap>", line 671, in _load_unlocked
File "<frozen importlib._bootstrap_external>", line 783, in exec_module
File "<frozen importlib._bootstrap>", line 219, in _call_with_frames_removed
File "C:\Users\frego\.virtualenvs\frego-6ij68a4f\lib\site-packages\django\core\management\commands\runserver.py", line 10, in <module>
from django.core.servers.basehttp import (
File "C:\Users\frego\.virtualenvs\frego-6ij68a4f\lib\site-packages\django\core\servers\basehttp.py", line 17, in <module>
from django.core.handlers.wsgi import LimitedStream
File "C:\Users\frego\.virtualenvs\frego-6ij68a4f\lib\site-packages\django\core\handlers\wsgi.py", line 5, in <module>
from django.core.handlers import base
File "C:\Users\frego\.virtualenvs\frego-6ij68a4f\lib\site-packages\django\core\handlers\base.py", line 15, in <module>
from .exception import convert_exception_to_response
File "C:\Users\frego\.virtualenvs\frego-6ij68a4f\lib\site-packages\django\core\handlers\exception.py", line 18, in <module>
from django.views import debug
File "C:\Users\frego\.virtualenvs\frego-6ij68a4f\lib\site-packages\django\views\__init__.py", line 1, in <module>
from django.views.generic.base import View
File "<frozen importlib._bootstrap>", line 991, in _find_and_load
File "<frozen importlib._bootstrap>", line 971, in _find_and_load_unlocked
File "<frozen importlib._bootstrap>", line 914, in _find_spec
File "<frozen importlib._bootstrap_external>", line 1342, in find_spec
File "<frozen importlib._bootstrap_external>", line 1314, in _get_spec
File "<frozen importlib._bootstrap_external>", line 1443, in find_spec
File "<frozen importlib._bootstrap_external>", line 1483, in _fill_cache
OSError: [WinError 1392] El archivo o directorio est▒ da▒ado o es ilegible: 'C:\\Users\\frego\\.virtualenvs\\frego-6ij68a4f\\lib\\site-packages\\django\\views\\generic'
It seems that the error is arisen from the LOGGING in the settings of the project. Take a look in the LOGGING['handlers'].

Resources