When importing keyring,
import keyring
for some reason I keep on getting error message: "AttributeError: module 'io' has no attribute 'text_encoding' " the line preceding the error refers to one of the site packages (py310compat.py on the zipp folder (File "C:\Users*user_name*\AppData\Local\Programs\Python\Python39\lib\site-packages\zipp\py310compat.py io.text_encoding if sys.version_info > (3, 10) else _text_encoding # type: ignore "
I've checked the py310compat.py on my Zipp folder, everything seems to be in place, unless my io library is on an outdated version ? (for some reason can't even find the io library folder on my local machine site packages sub folders, or seeing its version:
print(io.__version__)
will render: "AttributeError: module 'io' has no attribute 'version' " although:
import io
runs with no issues, so I guess it has something to do with the way my io was installed
I ran into this same problem when trying to backport the zipfile module from a newer version of Python.
The
iomodule is a Python standard library module, so it's part of Python itself (it won't be in site-packages). The problem is that theio.test_encodingwas added in Python 3.10 according to the docs.