运行 Ubuntu 12.04,我安装了通常的 python 2.7。
我需要 python 2.6 ,所以我下载了源代码并做了
./configure
make
sudo make install
Run Code Online (Sandbox Code Playgroud)
一个错误,因为我不想替换我的系统范围的 python 。现在一些程序停止工作,例如更新管理器
ImportError: No module named gi.repository
Run Code Online (Sandbox Code Playgroud)
我使用 update-alternatives 再次将 python 2.7 设为默认值,但是由于缺少某些模块,许多 python 应用程序仍然无法启动。
有人可以提示发生了什么以及解决它的最佳方法是什么?
提前致谢。
编辑 :
我可以通过将我自己的硬链接从 /etc/python 设置为 /etc/python2.7 来获得 apt-get 的一些功能。(所以我想使用 update-alternatives 确实没有多大好处。)我做了一个 dist-upgrade ,它基本上有效,但是通过 apt-get 管理的很多包仍然损坏。特别是,python-minimal的问题阻止了我想做的许多其他软件包的安装。
Setting up python-minimal (2.7.3-0ubuntu7) ...
Traceback (most recent call last):
File "/usr/local/lib/python2.7/runpy.py", line 162, in _run_module_as_main
"__main__", fname, loader, pkg_name)
File "/usr/local/lib/python2.7/runpy.py", line 72, in _run_code
exec code in …Run Code Online (Sandbox Code Playgroud) 我将 Ubuntu 从 17.04 更新到 17.10,然后更新到 18.04,现在我的 Python 似乎坏了。运行apt-get upgrade返回以下错误:
Reading package lists... Done
Building dependency tree
Reading state information... Done
You might want to run 'apt --fix-broken install' to correct these.
The following packages have unmet dependencies:
libopencv-highgui3.1 : Depends: libopencv-videoio3.1 (= 3.1.0+dfsg1-1~exp1ubuntu3) but it is not installable
Depends: libopencv-imgcodecs3.1 but it is not installable
libopencv-videostab3.1 : Depends: libopencv-videoio3.1 but it is not installable
libpython-all-dev : Depends: libpython-dev (= 2.7.14-2ubuntu1) but 2.7.15~rc1-1 is installed
python : PreDepends: …Run Code Online (Sandbox Code Playgroud)