apt upgrade or
apt update-manager I receive the following error:
Setting up update-notifier-common (3.168.1) ... Could not find platform independent libraries <prefix> Could not find platform dependent libraries <exec_prefix> Consider setting $PYTHONHOME to <prefix>[:<exec_prefix>] Fatal Python error: Py_Initialize: Unable to get the locale encoding ImportError: No module named 'encodings' Current thread 0x00007fa215e86700 (most recent call first): Aborted (core dumped) dpkg: error processing package update-notifier-common (--configure): subprocess installed post-installation script returned error exit status 134 dpkg: dependency problems prevent configuration of flashplugin-installer: flashplugin-installer depends on update-notifier-common (>= 0.119ubuntu2); however: Package update-notifier-common is not configured yet. dpkg: error processing package flashplugin-installer (--configure): dependency problems - leaving unconfigured No apport report written because the error message indicates its a followup error from a previous failure. Errors were encountered while processing: update-notifier-common flashplugin-installer E: Sub-process /usr/bin/dpkg returned an error code (1)
I've read through the many duplicate questions, and none of the solutions have worked for me.
Using Ubuntu 14.04, with Python 2.7.12 default, I manually installed Python 3.5 from source. I have never used a virtual environment to deal with the multiple versions. Since I'm very new to Ubuntu, I without thinking deleted many files and directories for Python3.5 from
/usr/lib though there are still Python3 and Python3.5 files in
/usr/bin. Despite the fatal error, Python 2.7.12 still works perfectly in shell, and
python -V still says 2.7.12 is the default version.
The above error results after unsetting both
echo $PYTHONHOME returns nothing, and then I enter
PYTHONHOME in the command line, I receive the following error (likewise for entering
Could not find platform independent libraries <prefix> Could not find platform dependent libraries <exec_prefix> Consider setting $PYTHONHOME to <prefix>[:<exec_prefix>] Fatal Python error: Py_Initialize: Unable to get the locale encoding ImportError: No module named 'encodings' Current thread 0x00007f57373f3700 (most recent call first): Aborted (core dumped)
When I enter
which python the command line returns
/usr/bin/python, and that file does have as its link target Python2.7. If I then set
export PYTHONHOME=/usr and again enter
PYTHONHOME into the command line, I get the following error:
Fatal Python error: Py_Initialize: Unable to get the locale encoding ImportError: No module named 'encodings' Current thread 0x00007f3de267e700 (most recent call first): Aborted (core dumped)
When I move my command line directory to my python directory and enter
python -m encodings I receive the following:
/usr/bin/python: No module named encodings.__main__; 'encodings' is a package and cannot be directly executed
...so I'm not even sure how I would make
PYTHONPATH aware of it as a module if it apparently is not a module. And regardless of how I set
PYTHONPATH, I have so far continued to get the same error when I run
Some other fixes I've attempted:
All these commands run without a problem, but do not fix the error
apt update apt clean apt autoclean
apt-get -f installboth yield the same error as
PYTHONHOMEdoes not fix the error, nor does setting
PYTHONHOMEto the directory indicated by
- I attempted to use the Synaptic package manager to fix broken packages, but this didn't fix the error.
- I checked to make sure that
/usr/bin/python3, and that file does exist (I didn't delete it).
/lost+founddirectory is currently empty, so there are no modules to restore from there.
apt-get install --reinstall python(and the same command with
python3.5) yields the same error as
I've found no other resources or answers to deal with this error. Should I try using a virtual environment to isolate the remaining files of my python versions? Should I attempt to fix my now corrupted manual installations of python3.5, and how would I do so since
--reinstall python yields a fatal error?