ScoRpion
ScoRpion

Reputation: 11474

How can I upgrade Python to a specific version?

I am currently working on Python 2.6.5 and I would like to upgrade to Python 2.6.6.

Is there a way I can do so?

Upvotes: 11

Views: 36592

Answers (3)

  1. Download your python version from https://www.python.org/downloads/

    Open a terminal

    tar -xzf python3.12.7.tgz
    
  2. cd Python-3.12.7

  3. Install dependencies

    sudo apt update
    sudo apt install build-essential libssl-dev libbz2-dev libreadline-dev libsqlite3-dev wget curl llvm libncurses5-dev libncursesw5-dev xz-utils tk-dev libffi-dev liblzma-dev python3-openssl git
    
  4. Run the configuration script

    ./configure --enable-optimizations --prefix=/usr
    
  5. Run

    make -j $(nproc)  
    
    sudo make altinstall
    
  6. Verify the installation
    Check that Python 3.12.7 is installed correctly:

    /usr/bin/python3.12 --version
    

Upvotes: -1

Lemmings19
Lemmings19

Reputation: 1471

In Linux:

  1. Select the version that you're looking for: https://www.python.org/downloads/
  2. From the appropriate version's page, copy the download link. (eg. https://www.python.org/ftp/python/3.8.3/Python-3.8.3.tgz)
  3. Go to the directory you want to download the compressed package to and run wget "https://www.python.org/ftp/python/3.8.3/Python-3.8.3.tgz"
  4. In that same directory, run tar -zxvf Python-3.8.3.tgz to extract Python
  5. cd into the directory where Python has been extracted to
  6. Run ./configure
  7. Run make
  8. Run make install
  9. Run python --version to check that the installation was successful

Python should now be installed at the desired version.

Upvotes: 10

Trott
Trott

Reputation: 70065

Download the appropriate installer (or, if they don't have one for your OS, source code) from http://www.python.org/download/releases/2.6.6/. Instructions from there will depend on your operating system, but I'm guessing you can handle it. (Plus, they have install instructions.)

Upvotes: 5

Related Questions