Forums

RecursionError: maximum recursion depth exceeded

Hi, i'm using python 3.6 in my apps and get the following error after installing loguru lib. Traceback ends with RecursionError: maximum recursion depth exceeded

After i close the console and run the file again, it runs ok only for 1 time.

Traceback (most recent call last):
  File "/home/teman77/botsarmydev/Beauty_Bot/handler_beauty.py", line 1, in <module>
    from telegram import Bot
  File "./telegram.py", line 1, in <module>
    import requests
  File "/home/teman77/.local/lib/python3.6/site-packages/requests/__init__.py", line 95, in <module>
    from urllib3.contrib import pyopenssl
  File "/home/teman77/.local/lib/python3.6/site-packages/urllib3/contrib/pyopenssl.py", line 46, in <module>
    import OpenSSL.SSL
  File "/usr/local/lib/python3.6/dist-packages/OpenSSL/__init__.py", line 8, in <module>
    from OpenSSL import rand, crypto, SSL
  File "/usr/local/lib/python3.6/dist-packages/OpenSSL/crypto.py", line 13, in <module>
    from cryptography.hazmat.primitives.asymmetric import dsa, rsa
  File "/usr/local/lib/python3.6/dist-packages/cryptography/hazmat/primitives/asymmetric/rsa.py", line 14, in <module>
    from cryptography.hazmat.backends.interfaces import RSABackend
  File "/usr/local/lib/python3.6/dist-packages/cryptography/hazmat/backends/__init__.py", line 7, in <module>
    import pkg_resources
  File "/home/teman77/.local/lib/python3.6/site-packages/pkg_resources/__init__.py", line 82, in <module>
    __import__('pkg_resources.extern.packaging.requirements')
  File "/home/teman77/.local/lib/python3.6/site-packages/pkg_resources/_vendor/packaging/requirements.py", line 9, in <module>
    from pkg_resources.extern.pyparsing import stringStart, stringEnd, originalTextFor, ParseException
  File "<frozen importlib._bootstrap>", line 961, in _find_and_load
  File "<frozen importlib._bootstrap>", line 950, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 646, in _load_unlocked
  File "<frozen importlib._bootstrap>", line 616, in _load_backward_compatible
  File "/home/teman77/.local/lib/python3.6/site-packages/pkg_resources/extern/__init__.py", line 43, in load_module
    __import__(extant)
  File "/home/teman77/.local/lib/python3.6/site-packages/pkg_resources/_vendor/pyparsing.py", line 966, in <module>
    MutableMapping.register(ParseResults)
  File "/usr/lib/python3.6/abc.py", line 158, in register
    if issubclass(subclass, cls):
  File "/usr/lib/python3.6/abc.py", line 158, in register
  File "/usr/lib/python3.6/abc.py", line 226, in __subclasscheck__
    if issubclass(subclass, scls):
  File "/usr/lib/python3.6/abc.py", line 226, in __subclasscheck__
    if issubclass(subclass, scls):
  File "/home/teman77/.local/lib/python3.6/site-packages/typing.py", line 1158, in __subclasscheck__
  File "/usr/lib/python3.6/abc.py", line 207, in __subclasscheck__
    ok = cls.__subclasshook__(subclass)

Some libraries are not compatible with the way that we reload consoles when you use the Run button. You can avoid that by closing the console between runs using ctrl-d from the prompt. Then, when you run it again, it will be in a new console.