I can no longer install or remove any software using apt-get. When I try I get the error:
Could not find platform independent libraries <prefix>
Consider setting $PYTHONHOME to <prefix>[:<exec_prefix>]
Fatal Python error: Py_Initialize: can't initialize sys standard streams
ImportError: No module names 'io'
I tried to reinstall python but that just brings up this error again.
I'm running Raspbian.
Update from comments:
Here is the error log: https://pastebin.com/nXmRTx03
and pip install io
gives me: https://pastebin.com/DtHqfc3n
1 Answer 1
As shown in the error log there seems to be a general problem with updates. Before trying anything else with python you should fix your update. You only do an sudo apt-get upgrade
. Before doing it you should update the packages lists. So first try to do:
rpi ~$ sudo apt update
rpi ~$ sudo apt full-upgrade
and reboot. You should now have an up to date system. Check with:
rpi ~$ apt list --upgradable
Listing... Done
It should not show any upgradable packages. If this does not help then you can try to reinitialze the packet manager. How to do it you can look at Raspberry Pi sudo apt-get update not working.
If you have a clean updated system then you can try to use python.
-
the "sudo apt update" works but the "sudo apt full-upgrade gives the same error as before.Tyler Bourne– Tyler Bourne2019年05月24日 21:04:11 +00:00Commented May 24, 2019 at 21:04
-
as soon as I hit y to continue the error appears.Tyler Bourne– Tyler Bourne2019年05月24日 21:05:06 +00:00Commented May 24, 2019 at 21:05
-
@TylerBourne Do you reinitialized the package manager?Ingo– Ingo2019年05月24日 23:21:48 +00:00Commented May 24, 2019 at 23:21
No module names 'io'
seems to me a very grievious issue.io
is a module upon which many Python-based programs operate.pip install io
might resolve it, if pip isn't dependent uponio
.