在手动覆盖/ usr /中的元素后修复Ubuntu上的python2.7安装

时间:2017-09-04 08:03:03

标签: python ubuntu apt

我从here下载了最新的ParaView,并认为使用

将tar.gz中的目录结构集成到我的/ usr /目录中会很聪明
sudo tar -xzvf ParaView-5.4.1-Qt5-OpenGL2-MPI-Linux-64bit.tar.gz -C /usr/ --strip-components=1

Paraview运行良好,但在今天重新启动后,我的guake终端拒绝启动

~> guake
   /usr/bin/python2: No module named guake

显然,我的python安装完全被破坏了:(我尝试重新安装guakepython-dev等等,没有任何帮助。即使运行pip失败并指出{中的问题{1}} - 模块:

ctypes

检查paraview tar.gz显示ctypes模块确实包含在内,并且正在解压缩覆盖它。 我真的需要一些帮助!

提前致谢。

修改

根据@BoboDarph的评论,我尝试使用相同的版本从源代码构建python并安装到/ usr。这是安装脚本:

~> pip install --upgrade pip
      File "/usr/lib/python2.7/ctypes/__init__.py", line 10, in <module>
        from _ctypes import Union, Structure, Array
    ImportError: /usr/lib/python2.7/_ctypes.so: undefined symbol: 
    PyUnicodeUCS2_FromUnicode

由于checkinstall无法安装生成的软件包,因为现有软件包的文件已被覆盖,我使用

强制安装
!#/bin/bash

sudo apt-get install build-essential checkinstall
sudo apt-get install libreadline-gplv2-dev libncursesw5-dev libssl-dev libsqlite3-dev tk-dev libgdbm-dev libc6-dev libbz2-dev

version=2.7.11
wget https://www.python.org/ftp/python/$version/Python-$version.tgz

tar -xvf Python-$version.tgz
cd Python-$version

./configure --prefix=/usr
make profile-opt
sudo checkinstall

sudo dpkg --force-overwrite --install python_2.7.11-1_amd64.deb 现在再次工作,但即使重新安装后,guake也无效。现在看来事情真的很糟糕,我无法弄清楚如何解决问题。例如。运行

pip

现在建议删除几乎所有系统包以解决冲突,请参阅pastebin

非常感谢任何拯救我的系统的帮助!

0 个答案:

没有答案