Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Import fails on python 3.10 #30

Open
pkesso opened this issue Dec 3, 2021 · 1 comment
Open

Import fails on python 3.10 #30

pkesso opened this issue Dec 3, 2021 · 1 comment

Comments

@pkesso
Copy link

pkesso commented Dec 3, 2021

I tried to use pyspectator with python 3.10 on Windows 11 and got this error:

>>> from pyspectator.computer import Computer
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "C:\Users\admin\Documents\python\dashboard_win\lib\site-packages\pyspectator\computer.py", line 5, in <module>
    from pyspectator.memory import NonvolatileMemory, VirtualMemory, SwapMemory
  File "C:\Users\admin\Documents\python\dashboard_win\lib\site-packages\pyspectator\memory.py", line 5, in <module>
    from pyspectator.collection import LimitedTimeTable
  File "C:\Users\admin\Documents\python\dashboard_win\lib\site-packages\pyspectator\collection.py", line 1, in <module>
    from collections import MutableMapping, Container
ImportError: cannot import name 'MutableMapping' from 'collections' (C:\Users\admin\AppData\Local\Programs\Python\Python310\lib\collections\__init__.py)

It seems to be specific for modern python versions (3.9+) : https://docs.python.org/3.9/whatsnew/3.9.html#you-should-check-for-deprecationwarning-in-your-code

And it works this way now:

>>> from collections import MutableMapping
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
ImportError: cannot import name 'MutableMapping' from 'collections' (C:\Users\admin\AppData\Local\Programs\Python\Python310\lib\collections\__init__.py)
>>> from collections.abc import MutableMapping
>>>

pyspectator==1.2.2
Python 3.10.0
Windows11 x64

@kaixinol
Copy link

#31

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants