mashed-potatoes / PotatoNV-crossplatform

it is not OK iirc
GNU Affero General Public License v3.0
53 stars 14 forks source link

Not working under Ubuntu 22.04 LTS with python3.10 #6

Open abkro opened 2 years ago

abkro commented 2 years ago

After a number of problems while trying to install the dependencies which I finally resolved by installing these manually one by one with pip install I ran: python3 -m usrlock and got this:

$ python3 -m usrlock
Traceback (most recent call last):
  File "/usr/lib/python3.10/runpy.py", line 196, in _run_module_as_main
    return _run_code(code, main_globals, None,
  File "/usr/lib/python3.10/runpy.py", line 86, in _run_code
    exec(code, run_globals)
  File "/home/ari/github/PotatoNV-crossplatform/usrlock/__main__.py", line 12, in <module>
    from . import main
  File "/home/ari/github/PotatoNV-crossplatform/usrlock/main.py", line 8, in <module>
    from PyInquirer import prompt
  File "/home/ari/github/PotatoNV-crossplatform/lib/python3.10/site-packages/PyInquirer/__init__.py", line 6, in <module>
    from prompt_toolkit.token import Token
  File "/home/ari/github/PotatoNV-crossplatform/lib/python3.10/site-packages/prompt_toolkit/__init__.py", line 16, in <module>
    from .interface import CommandLineInterface
  File "/home/ari/github/PotatoNV-crossplatform/lib/python3.10/site-packages/prompt_toolkit/interface.py", line 19, in <module>
    from .application import Application, AbortAction
  File "/home/ari/github/PotatoNV-crossplatform/lib/python3.10/site-packages/prompt_toolkit/application.py", line 8, in <module>
    from .key_binding.bindings.basic import load_basic_bindings
  File "/home/ari/github/PotatoNV-crossplatform/lib/python3.10/site-packages/prompt_toolkit/key_binding/bindings/basic.py", line 9, in <module>
    from prompt_toolkit.renderer import HeightIsUnknownError
  File "/home/ari/github/PotatoNV-crossplatform/lib/python3.10/site-packages/prompt_toolkit/renderer.py", line 11, in <module>
    from prompt_toolkit.styles import Style
  File "/home/ari/github/PotatoNV-crossplatform/lib/python3.10/site-packages/prompt_toolkit/styles/__init__.py", line 8, in <module>
    from .from_dict import *
  File "/home/ari/github/PotatoNV-crossplatform/lib/python3.10/site-packages/prompt_toolkit/styles/from_dict.py", line 9, in <module>
    from collections import Mapping
ImportError: cannot import name 'Mapping' from 'collections' (/usr/lib/python3.10/collections/__init__.py)
i35010u commented 2 years ago

same issue on Debian sid with python 3.10.7


i35010u@debian:~/PotatoNV-crossplatform$ python3 -m usrlock
Traceback (most recent call last):
  File "/usr/lib/python3.10/runpy.py", line 196, in _run_module_as_main
    return _run_code(code, main_globals, None,
  File "/usr/lib/python3.10/runpy.py", line 86, in _run_code
    exec(code, run_globals)
  File "/home/i35010u/PotatoNV-crossplatform/usrlock/__main__.py", line 12, in <module>
    from . import main
  File "/home/i35010u/PotatoNV-crossplatform/usrlock/main.py", line 8, in <module>
    from PyInquirer import prompt
  File "/home/i35010u/.local/lib/python3.10/site-packages/PyInquirer/__init__.py", line 6, in <module>
    from prompt_toolkit.token import Token
  File "/home/i35010u/.local/lib/python3.10/site-packages/prompt_toolkit/__init__.py", line 16, in <module>
    from .interface import CommandLineInterface
  File "/home/i35010u/.local/lib/python3.10/site-packages/prompt_toolkit/interface.py", line 19, in <module>
    from .application import Application, AbortAction
  File "/home/i35010u/.local/lib/python3.10/site-packages/prompt_toolkit/application.py", line 8, in <module>
    from .key_binding.bindings.basic import load_basic_bindings
  File "/home/i35010u/.local/lib/python3.10/site-packages/prompt_toolkit/key_binding/bindings/basic.py", line 9, in <module>
    from prompt_toolkit.renderer import HeightIsUnknownError
  File "/home/i35010u/.local/lib/python3.10/site-packages/prompt_toolkit/renderer.py", line 11, in <module>
    from prompt_toolkit.styles import Style
  File "/home/i35010u/.local/lib/python3.10/site-packages/prompt_toolkit/styles/__init__.py", line 8, in <module>
    from .from_dict import *
  File "/home/i35010u/.local/lib/python3.10/site-packages/prompt_toolkit/styles/from_dict.py", line 9, in <module>
    from collections import Mapping
ImportError: cannot import name 'Mapping' from 'collections' (/usr/lib/python3.10/collections/__init__.py)
ksnnkr commented 1 year ago

I also faced the same problem on Ubuntu 22.10, but was able to solve it with the following method.

Add from _collections_abc import Mappingto/usr/lib/python3.10/collections/__init__.py (Websites I referred to (written in Japanese) : https://coronene.hatenablog.com/entry/python/importerror)