我正在使用Linux (Xubuntu),并且只知道基本的命令--我是Linux新手。
TLTR:如何重新安装Python,希望所有的包依赖关系都将得到修复?我试过这样做:
sudo apt-get update && sudo apt-get upgrade && sudo apt-get autoremove
我在<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)所以我又谷歌了一遍。应用这里的答案:我把export PYTHONHOME=/usr/local写进了终端机,什么也没发生。我不知道图书馆的去向。它们不位于python3.6文件夹所在的usr/local/lib中。
我还简单地尝试了:
dpkg --configure -a和我
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,你能告诉我下一步该尝试什么吗?/如何修复这些错误?,我认为重新开始也许是个好主意。然而,我甚至不能重新开始。我被困住了,现在我知道该怎么做了。如有任何建议,我将不胜感激。
我的最终目标是优化BLAS,这样我就可以解决稀疏特征值问题。在我尝试这样做的时候,我遇到了几个错误(也是<prefix>错误),所以重新安装Python似乎是个好主意。
发布于 2021-03-21 20:49:33
由于错误太多,我重新安装了整个Linux。与我试图解决这个问题的时间相比,重新安装只花了我一小部分时间。
https://stackoverflow.com/questions/66295728
复制相似问题