Octoprint on macOS; 'Callable' has no attribute '_abc_registry'

What is the problem?

When I run octoprint serve error occurs:

Traceback (most recent call last):
  File "/usr/local/bin/octoprint", line 11, in <module>
    load_entry_point('OctoPrint==1.3.12', 'console_scripts', 'octoprint')()
  File "/usr/local/lib/python3.7/site-packages/OctoPrint-1.3.12-py3.7.egg/octoprint/__init__.py", line 605, in main
    from octoprint.util.fixes import patch_sarge_async_on_py2
  File "/usr/local/lib/python3.7/site-packages/OctoPrint-1.3.12-py3.7.egg/octoprint/util/__init__.py", line 27, in <module>
    from typing import Union
  File "/usr/local/lib/python3.7/site-packages/typing-3.7.4.1-py3.7.egg/typing.py", line 1357, in <module>
    class Callable(extra=collections_abc.Callable, metaclass=CallableMeta):
  File "/usr/local/lib/python3.7/site-packages/typing-3.7.4.1-py3.7.egg/typing.py", line 1005, in __new__
    self._abc_registry = extra._abc_registry
AttributeError: type object 'Callable' has no attribute '_abc_registry'

Octoprint was installed with python2.7, as this post suggested. No search result came up with keyword abc_registry

What did you already try to solve it?

No other error message was shown during installation process. I'm not sure what I should try.

Logs (octoprint.log, serial.log or output on terminal tab at a minimum, browser error console if UI issue ... no logs, no support!)

Traceback (most recent call last):
  File "/usr/local/bin/octoprint", line 11, in <module>
    load_entry_point('OctoPrint==1.3.12', 'console_scripts', 'octoprint')()
  File "/usr/local/lib/python3.7/site-packages/OctoPrint-1.3.12-py3.7.egg/octoprint/__init__.py", line 605, in main
    from octoprint.util.fixes import patch_sarge_async_on_py2
  File "/usr/local/lib/python3.7/site-packages/OctoPrint-1.3.12-py3.7.egg/octoprint/util/__init__.py", line 27, in <module>
    from typing import Union
  File "/usr/local/lib/python3.7/site-packages/typing-3.7.4.1-py3.7.egg/typing.py", line 1357, in <module>
    class Callable(extra=collections_abc.Callable, metaclass=CallableMeta):
  File "/usr/local/lib/python3.7/site-packages/typing-3.7.4.1-py3.7.egg/typing.py", line 1005, in __new__
    self._abc_registry = extra._abc_registry
AttributeError: type object 'Callable' has no attribute '_abc_registry'

**Additional information about your setup** (OctoPrint version, OctoPi version, printer, firmware, browser, operating system, ... **as much data as possible**)

I was cloned from github repo master branch so I think OctoPrint version is 1.3.12, printer in Anycubic i3 Mega, OS is macOS 10.14.6, Python 2.7

It looks like you are trying to run OctoPrint 1.3.12 with Python 3.7. OctoPrint 1.3.x is not compatible with Python 3.x. OctoPrint 1.4 is currently in testing (RC status), and it will be compatible with Python 3.x.

You can either switch to the rc/devel branch (instead of the master branch), which should get you the latest version that is compatible with Python 3 (OctoPrint 1.4.0 RC3 at the moment), or switch to using Python 2.7 instead of Python 3.7.

1 Like

On top of what I said above, the actual _abc_registry error seems to be caused by an incompatibility between Python 3.7 and the typing module:


I'm not sure if the typing module is required for OctoPrint, but the advice is to either downgrade to Python 3.6 or remove the typing module with pip uninstall typing.

1 Like

oh, the error log it self had answer.. thank you for the answer

btw I installed Octoprint with python2.7 in mind, python2.7 -m pip install -U pyobjc and python2.7 setup.py install, how do I run Octoprint from python2.7? Please bear my ignorance. Many thanks.

Did you follow the post you linked to? Because the command you posted is not found in that thread. Be sure to read (and follow!) the top of the post, which makes you set up a virtualenv.

oh yes, those commands are what I did different from that post, which I had to because I have set python3 as my default python version.

So I set up virtualenv and activated venv and then installed pip dependencies and ran python2.7 setup.py install. Only part I wasn't able to figure out was how to run Octoprint serve with python2.7

oh and I managed to run Octoprint from devel branch so thank you very much for pointing direction. I wasn't aware python3 support was under development.