2

I am using an Ubuntu 16.04 machine. As far as I know, I have the newest versions of Python 2 and 3 correctly installed:

$ python --version
Python 2.7.13

$ python2 --version  
Python 2.7.13  

$ python3 --version  
Python 3.6.2

However, when I try to install other packages that depend on python, apt-get does not seem to recognize python and therefore fail to install packages that depend on any python-related stuff.

e.g.,

$ sudo apt-get install python-wxversion

leads to:

Some packages could not be installed. This may mean that you have
requested an impossible situation or if you are using the unstable
distribution that some required packages have not yet been created
or been moved out of Incoming.
The following information may help to resolve the situation:

> The following packages have unmet dependencies:
 python-wxversion : Depends: python:any (< 2.8)
                    Depends: python:any (>= 2.7.5-5~)
E: Unable to correct problems, you have held broken packages.

Other python-related installs seem to cause similar issue. Any suggestions?

(sudo apt-get install -f did nothing.)

You'reAGitForNotUsingGit
  • 14,669
  • 9
  • 48
  • 83
Sanha Cheong
  • 321
  • 1
  • 3
  • 6
  • Is the dependency package itself installed (`apt-cache policy python`)? – steeldriver Aug 10 '17 at 23:33
  • @steeldriver `apt-cache policy python` gives: `python: Installed: 3.6.2-1 Candidate: 3.6.2-1 ` It shows 3.6.2 instead of 2.7.13, probably because of aliases I have. Do you think this could be the problem? python-wxversion is looking for python2's, but this recognizes 3 as default? – Sanha Cheong Aug 10 '17 at 23:47
  • I don't think aliases would affect that - how exactly did you install the indicated versions of python2 and python3? It looks like you have installed `python3.6.2` as package `python` (possibly from a PPA or .deb file - or from source via `checkinstall`?) – steeldriver Aug 11 '17 at 00:26
  • @steeldriver both python versions are installed using source.tar.xz and `checkinstall` – Sanha Cheong Aug 11 '17 at 00:41
  • https://askubuntu.com/questions/673870/problems-with-apt-dependencies-after-install-of-python-3-5?rq=1 Found a same/similar problem. Basically, when installing `python3` from source files and `checkinstall`, check install "overwrites" what `python` is in the system. Therefore, packages looking for `python` (which is really looking for `python2`) fails to recognize the `python2` that's actually there. – Sanha Cheong Aug 11 '17 at 03:48
  • probably the installation is looking for default python version on tour machine do alias python=python3 and then try installing – Prakash Palnati Aug 14 '17 at 06:25

0 Answers0