IPython extension gives ImportError: cannot import name 'ThreadingMixIn' from 'werkzeug.serving'
carlosplanchon opened this issue · 3 comments
carlosplanchon commented
In [1]: %load_ext birdseye
---------------------------------------------------------------------------
ImportError Traceback (most recent call last)
Input In [1], in <cell line: 1>()
----> 1 get_ipython().run_line_magic('load_ext', 'birdseye')
File ~/.pyenv/versions/3.10.4/lib/python3.10/site-packages/IPython/core/interactiveshell.py:2294, in InteractiveShell.run_line_magic(self, magic_name, line, _stack_depth)
2292 kwargs['local_ns'] = self.get_local_scope(stack_depth)
2293 with self.builtin_trap:
-> 2294 result = fn(*args, **kwargs)
2295 return result
File ~/.pyenv/versions/3.10.4/lib/python3.10/site-packages/IPython/core/magics/extension.py:33, in ExtensionMagics.load_ext(self, module_str)
31 if not module_str:
32 raise UsageError('Missing module name.')
---> 33 res = self.shell.extension_manager.load_extension(module_str)
35 if res == 'already loaded':
36 print("The %s extension is already loaded. To reload it, use:" % module_str)
File ~/.pyenv/versions/3.10.4/lib/python3.10/site-packages/IPython/core/extensions.py:76, in ExtensionManager.load_extension(self, module_str)
69 """Load an IPython extension by its module name.
70
71 Returns the string "already loaded" if the extension is already loaded,
72 "no load function" if the module doesn't have a load_ipython_extension
73 function, or None if it succeeded.
74 """
75 try:
---> 76 return self._load_extension(module_str)
77 except ModuleNotFoundError:
78 if module_str in BUILTINS_EXTS:
File ~/.pyenv/versions/3.10.4/lib/python3.10/site-packages/IPython/core/extensions.py:99, in ExtensionManager._load_extension(self, module_str)
94 print(("Loading extensions from {dir} is deprecated. "
95 "We recommend managing extensions like any "
96 "other Python packages, in site-packages.").format(
97 dir=compress_user(self.ipython_extension_dir)))
98 mod = sys.modules[module_str]
---> 99 if self._call_load_ipython_extension(mod):
100 self.loaded.add(module_str)
101 else:
File ~/.pyenv/versions/3.10.4/lib/python3.10/site-packages/IPython/core/extensions.py:151, in ExtensionManager._call_load_ipython_extension(self, mod)
149 def _call_load_ipython_extension(self, mod):
150 if hasattr(mod, 'load_ipython_extension'):
--> 151 mod.load_ipython_extension(self.shell)
152 return True
File ~/.pyenv/versions/3.10.4/lib/python3.10/site-packages/birdseye/__init__.py:38, in load_ipython_extension(ipython_shell)
37 def load_ipython_extension(ipython_shell):
---> 38 from birdseye.ipython import BirdsEyeMagics
39 ipython_shell.register_magics(BirdsEyeMagics)
File ~/.pyenv/versions/3.10.4/lib/python3.10/site-packages/birdseye/ipython.py:13, in <module>
11 from traitlets import Unicode, Int, Bool
12 from werkzeug.local import LocalProxy
---> 13 from werkzeug.serving import ThreadingMixIn
15 from birdseye.bird import PY2, Database
16 from birdseye import server, eye
ImportError: cannot import name 'ThreadingMixIn' from 'werkzeug.serving' (/home/andrei/.pyenv/versions/3.10.4/lib/python3.10/site-packages/werkzeug/serving.py)
I tried uninstalling and then installing Werkzeug and Flask, but the same error is still happening.
alexmojaki commented
Thanks for the report. Looks like installing werkzeug<2
should work. Wonder why no one reported this before.
carlosplanchon commented
Hey!, by the way. I looked into your profile. Futurecoder looks like a great project, and its a great vision you have.
I think this kind of work should have more visibility.
My respects.
alexmojaki commented
Hey!, by the way. I looked into your profile. Futurecoder looks like a great project, and its a great vision you have. I think this kind of work should have more visibility. My respects.
Thanks, please share it with all your friends!
The fix for this bug has been released to PyPI.