I can use protonvpn
as the input in the terminal and get some lines back about importing modules, etc. But then this is the last line and it abruptly stops:
ImportError: cannot import name ‘Mapping’ from ‘collections’ (/usr/lib/python3.10/collections/__init__.py)
(Edit: Reddit formatted the double underscores as bolding the surrounding word. Fixed that for my version of reddit with escapes.)
ProtonVPN will happily launch just fine on a different user account.
So among the many programs installed, there is some conflict. (Gotta love Linux.)
I have tried to purge and autoremove protonvpn, then reinstall. I tried using
sudo apt-get install protonvpn -f
But that didn’t work.
When I do that, part of the info prior to me inputting Y to accept installation is this:
0 upgraded, 18 newly installed, 0 to remove and 2 not upgraded.
Well, I want to make sure the “2 not upgraded” is forcefully upgraded in case that’s part of the python3.10 collections stuff.
Googling for the top error gets me some stuff on stack overflow as if I was the developer and just tells me to change collections to collections.abc. I’m not sure that’s under my control to make that change?
Well maybe I can make that change manually to the file that is trying to be loaded and throws the above error.
…
So I thought I submitted the post, but I guess I did this troubleshooting prior to submitting. I am putting this out there in case anyone happens to come across it via google search. Be warned, this may well have broken any other program for me! I haven’t tried to launch everything. Be sure to make backups of any files you’re editing. Or just refer to this and undo the changes (partly why I’m posting it as well) if anything breaks.
Before my changes:
File "/home/owner/.local/lib/python3.10/site-packages/urllib3/util/selectors.py", line 14, in <module>
from collections import namedtuple, Mapping
ImportError: cannot import name 'Mapping' from 'collections' (/usr/lib/python3.10/collections/__init__.py)
What I tried was changing that line to being from collections.abc import namedtuple, Mapping
but I got a new error:
After my changes:
File "/home/owner/.local/lib/python3.10/site-packages/urllib3/util/selectors.py", line 14, in <module>
from collections.abc import namedtuple, Mapping
ImportError: cannot import name 'namedtuple' from 'collections.abc' (/usr/lib/python3.10/collections/abc.py)
So what I changed was in util/selectors.py I changed the import to be from collections import nameduple
and put on a new line from collections.abc import Mapping
New error:
File "/home/owner/.local/lib/python3.10/site-packages/urllib3/_collections.py", line 2, in <module>
from collections import Mapping, MutableMapping
ImportError: cannot import name 'Mapping' from 'collections' (/usr/lib/python3.10/collections/__init__.py)
So what I changed was in urllib3/_collections.py I changed it to be from collections.abc import MutableMapping, Mapping
New error:
File "/home/owner/.local/lib/python3.10/site-packages/requests/cookies.py", line 172, in <module>
class RequestsCookieJar(cookielib.CookieJar, collections.MutableMapping):
AttributeError: module 'collections' has no attribute 'MutableMapping'
So what I changed now is going to be /requests/cookies.py and change it to be class RequestsCookieJar(cookielib.CookieJar, collections.abc.MutableMapping):
New error: I’m just chasing my tail throughout all these imports…
File "/home/owner/.local/lib/python3.10/site-packages/requests/structures.py", line 15, in <module>
class CaseInsensitiveDict(collections.MutableMapping):
AttributeError: module 'collections' has no attribute 'MutableMapping'
So what I changed is /requests/structures.py and made that class CaseInsensitiveDict(collections.abc.MutableMapping):
File "/home/owner/.local/lib/python3.10/site-packages/requests/sessions.py", line 13, in <module>
from collections import Mapping
ImportError: cannot import name 'Mapping' from 'collections' (/usr/lib/python3.10/collections/__init__.py)
Changed it to from collections.abc import Mapping
And yay! After all that, it launches! And seems to be functional. (Thunderbird trying to refresh my inboxes upset Microsoft that they blocked the connection being from a different IP and texted me to let me know. So, success?)