LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Software (https://www.linuxquestions.org/questions/linux-software-2/)
-   -   upgrading from a version of python to the other (https://www.linuxquestions.org/questions/linux-software-2/upgrading-from-a-version-of-python-to-the-other-4175633687/)

rpaun 07-10-2018 05:15 AM

upgrading from a version of python to the other
 
Hello,

I have recently installed Linux Mint 19 and noticed that it comes with python2.7.15rc1-1

This version of python (with the release candidate) is the current version from the repository, but I noticed that a newer version (and more stable) is available.

I ran the sudo apt install python-dev command and I get this:

Reading package lists... Done
Building dependency tree
Reading state information... Done
python-dev is already the newest version (2.7.15~rc1-1).
0 to upgrade, 0 to newly install, 0 to remove and 0 not to upgrade.

Is there another way to upgrade to the newer version of python besides the classical: get package, untar it and then configure, make and make install?

Thank you kindly for taking your time to read my thread.

ondoho 07-10-2018 06:37 AM

are you talking about python2 vs python3?
they are suupposed to co-exist.
installing python3 will not remove python2.

Habitual 07-10-2018 08:19 AM

Mint comes with both python2 and python3.
Don't fix it if it isn't broken.


terminal >
Code:

python3
I'd guess 90% of the system's package Management utilities rely on python2.

Upgrade that at your peril.

hydrurga 07-10-2018 08:35 AM

To back up the other posters, both Python 2 and Python 3 are very important for the correct functioning of Mint. Both should be maintained at the repo versions. If you need a more up-to-date version of either Python 2 or 3, and you don't want to screw up your system, then you would be best advised to choose a rolling distro or a fixed-release distro with that version in its base repos.

Just because a package version is named as a release candidate, as is the case for the version of Python 2 in the Mint 19/Ubuntu 18.04 repos, doesn't mean that it isn't stable or well-tested (it normally has to be both of these to get into the repos in the first place).

pan64 07-10-2018 08:50 AM

which one is that "newer version (and more stable)"?

rpaun 07-10-2018 09:16 PM

I am talking about python2. I do not want to mess with python2 because a lot of things depend on it.

I am trying to install some software and it has some issues with python. The wait for repository to upgrade or try another distro is not a solution to me.

scasey 07-10-2018 09:51 PM

Aha!
Please post the problems you are having with the software you’re trying to install.
What is the software? What are the “issues”?

rpaun 07-10-2018 11:37 PM

Here are the lines where it crashes:

checking for a version of Python >= '2.1.0'... yes
checking for a version of Python >= '2.7.3'... Traceback (most recent call last):
File "<string>", line 1, in <module>
File "ax_python_devel_vpy.py", line 6, in __init__
self.vpy = self.vtup(platform.python_version())
File "ax_python_devel_vpy.py", line 3, in vtup
return map(int, s.strip().split("."))
ValueError: invalid literal for int() with base 10: '15rc1'
no
configure: error: this package requires Python >= '2.7.3'.
If you have it installed, but it isn't the default Python
interpreter in your system path, please pass the PYTHON_VERSION
variable to configure. See ``configure --help'' for reference.

The problem is that when the program looks for a version newer than python 2.7.3, it runs into this problem:

ValueError: invalid literal for int() with base 10: '15rc1'

This is why I initially asked if there is a way to force an installation of python2.7.15 over 2.7.15rc1

The name of the software is RIVET and it can be downloaded from rivet.hepforge.org

scasey 07-11-2018 01:17 AM

Quote:

Originally Posted by rpaun (Post 5878001)
configure: error: this package requires Python >= '2.7.3'.
If you have it installed, but it isn't the default Python
interpreter in your system path, please pass the PYTHON_VERSION
variable to configure. See ``configure --help'' for reference.

OK.
You have a version of python2 that is > 2.7.3...The version you have installed is 2.7.15, so you do not need to upgrade python2.

First, review configure --help (or maybe ./configure --help when in the installation directory).

Have you tried doing what the error messages suggested?
What does
Code:

which python
return? (my server returns /bin/python)
Then enter the value returned with --version
Code:

/bin/python --version
I think that will tell you what the "default" version is.

Have you read and followed these instruction?

The bottom line of my post is that you're chasing the wrong problem. Again, you appear to have a proper version of python installed...the issue appears to be that the install script isn't finding it. That's what you need to address.

rpaun 07-11-2018 02:20 AM

I have tried to review what the error message says.

It seems that there should be some alterations in the configure file, but that is out of my league. You are correct about addressing the wrong problem, but I don't know how to adjust the script in such a way to make it work.

pan64 07-11-2018 03:59 AM

for me it looks like it tried to understand 15rc1 as a version number - and failed.
probably installing an earlier version (like 2.7.14) would be good enough.

scasey 07-11-2018 04:18 AM

Heck of a good catch, pan64!!

I don’t know Mint...how do we help them with the downgrade?
OR (maybe better)
"pass[ing] the PYTHON_VERSION variable to configure"

rpaun...What does
Code:

configure --help
tell you??

ondoho 07-11-2018 05:44 AM

^ ok that's probably something to check out.

i was thinking:
  • try to explicitely run with python2:
    Code:

    python2 /path/to/script
  • please show us
    Code:

    ls -l $(which python)


All times are GMT -5. The time now is 08:23 PM.