0

I have an older Ubuntu/Linux Mint version where the newest Python in apt is 2.7.6. I have some problems with that version, so I built 2.7.14 from source. But as soon as I leave the Terminal, Python reports the wrong version.

Terminal from which I built and installed Python:

python
Python 2.7.14 (default, Aug 14 2018, 13:40:31)
[GCC 6.4.0 20180424] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import sys
>>> sys.executable
'/usr/local/bin/python'

A second terminal started after the build

python
Python 2.7.6 (default, Nov 23 2017, 15:53:45)
[GCC 4.8.4] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import sys
>>> sys.executable
'/usr/local/bin/python'

Even worse the actual binary that was built. Terminal from which I build:

/usr/local/lib/python2.7.14/bin/python2.7
Python 2.7.14 (default, Aug 14 2018, 13:40:31)
[GCC 6.4.0 20180424] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import sys
>>> sys.executable
'/usr/local/lib/python2.7.14/bin/python2.7'

Second Terminal:

/usr/local/lib/python2.7.14/bin/python2.7
Python 2.7.6 (default, Nov 23 2017, 15:53:45)
[GCC 4.8.4] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import sys
>>> sys.executable
'/usr/local/lib/python2.7.14/bin/python2.7'
2
  • This may shed some light Mismatch between sys.executable and sys.version in Python - what is your PATH in each of the cases above? Commented Aug 14, 2018 at 13:03
  • @steeldriver I had a couple of other issues, so I decided to upgrade the machine to Ubuntu 16.04 and have a clean install. This fixed any issues but I didn't had the time to solve multiple issues. But yes probably some paths were ill defined or other linkers were broken
    – DarkCell
    Commented Aug 29, 2018 at 13:24

0

You must log in to answer this question.

Browse other questions tagged .