11

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?

2
  • 3
    Note, Python 2.6.7 is the most recent Python 2.6 release but Python 2.6 is now in security-fix-only mode. Consider upgrading to Python 2.7.x, which is in bug-fix-only mode, or, eventually, to Python 3. Commented Nov 26, 2011 at 7:33
  • I also suggest upgrading to 2.7.2. If you want a constant environment, independant of the OS's Python distribution, use virtualenv. You can put your version of python and it's required libraries in a virtualenv. Commented Nov 26, 2011 at 8:27

3 Answers 3

10

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.

Sign up to request clarification or add additional context in comments.

1 Comment

When I ran the commands, I need to run with "sudo" in step 8 "make install", else there is a permission issue. And with sudo, I met the error "zipimport.ZipImportError: can't decompress data; zlib not available", so I had to run "sudo apt-get install zlib1g-dev". Finally the installation is successful.
5

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.)

Comments

-1
  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
    

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.