2

I am using Linux (Xubuntu) and know just basic commands - I am new to Linux.

TLTR: How to reinstall Python with the hope that all package dependencies will be fixed? I tried based on thise:

sudo apt-get update && sudo apt-get upgrade && sudo apt-get autoremove

I got errors with <prefix>:

Preparing to unpack .../python-pil_5.1.0-1ubuntu0.4_amd64.deb ...
Could not find platform independent libraries <prefix>
Could not find platform dependent libraries <exec_prefix>
Consider setting $PYTHONHOME to <prefix>[:<exec_prefix>]
ImportError: No module named site

dpkg: warning: old python-pil:amd64 package pre-removal script subprocess returned error exit status 1

dpkg: trying script from the new package instead ...
Could not find platform independent libraries <prefix>
Could not find platform dependent libraries <exec_prefix>
Consider setting $PYTHONHOME to <prefix>[:<exec_prefix>]
ImportError: No module named site

dpkg: error processing archive /var/cache/apt/archives/python-pil_5.1.0-1ubuntu0.4_amd64.deb (--unpack):
 new python-pil:amd64 package pre-removal script subprocess returned error exit status 1
Could not find platform independent libraries <prefix>
Could not find platform dependent libraries <exec_prefix>
Consider setting $PYTHONHOME to <prefix>[:<exec_prefix>]
ImportError: No module named site
dpkg: error while cleaning up:
 installed python-pil:amd64 package post-installation script subprocess returned error exit status 1
Preparing to unpack .../libaudit1_1%3a2.8.2-1ubuntu1.1_amd64.deb ...
Unpacking libaudit1:amd64 (1:2.8.2-1ubuntu1.1) over (1:2.8.2-1ubuntu1) ...
Errors were encountered while processing:
 /var/cache/apt/archives/python-pil_5.1.0-1ubuntu0.4_amd64.deb
E: Sub-process /usr/bin/dpkg returned an error code (1)

So I googled again. Applying the answer from here: I wrote export PYTHONHOME=/usr/local into the terminal and nothing happened. I do not know the destination of libraries. They are not in usr/local/lib where python3.6 folder is.

I also tried simply :

dpkg --configure -a and I got

dpkg: error processing package python-numpy (--configure):
 package is in a very bad inconsistent state; you should
 reinstall it before attempting configuration
dpkg: error processing package python-pil:amd64 (--configure):
 package is in a very bad inconsistent state; you should
 reinstall it before attempting configuration
dpkg: dependency problems prevent configuration of python-scipy:
 python-scipy depends on python-numpy (>= 1:1.13.1); however:
  Package python-numpy is not configured yet.
 python-scipy depends on python-numpy-abi9; however:
  Package python-numpy-abi9 is not installed.
  Package python-numpy which provides python-numpy-abi9 is not configured yet.

dpkg: error processing package python-scipy (--configure):
 dependency problems - leaving unconfigured
dpkg: dependency problems prevent configuration of python-matplotlib:
 python-matplotlib depends on python-numpy (>= 1:1.13.1); however:
  Package python-numpy is not configured yet.
 python-matplotlib depends on python-numpy-abi9; however:
  Package python-numpy-abi9 is not installed.
  Package python-numpy which provides python-numpy-abi9 is not configured yet.

dpkg: error processing package python-matplotlib (--configure):
 dependency problems - leaving unconfigured
Errors were encountered while processing:
 python-numpy
 python-pil:amd64
 python-scipy
 python-matplotlib

Can you advice what shall I try next?/ How to fix these errors? I thought that starting anew might be a good idea. However, I cannot even start anew. I am stuck and I do now know what to do. I will appreciate any advice.

My ultimate goal is to optimize BLAS, so I can solve sparse eigenvalue problems. While I was trying to do so, I encountered several errors (also one with <prefix> ) so that's why reinstalling Python seemed to be a good idea.

  • This is more suitable for askubuntu.com. There, make sure you read the site guidelines though and also the description of tags before applying them. – Ulrich Eckhardt Mar 21 '21 at 21:12

1 Answers1

0

Since there were too many errors, I reinstalled the whole Linux. Reinstalling took me a fraction of the time compared to the time I spend trying to figure this issue out.