Latest python version (Nearly Solved)

Quick to answer questions about finding your way around Linux Mint as a new user.
Forum rules
There are no such things as "stupid" questions. However if you think your question is a bit stupid, then this is the right place for you to post it. Stick to easy to-the-point questions that you feel people can answer fast. For long and complicated questions use the other forums in the support section.
Before you post read how to get help. Topics in this forum are automatically closed 6 months after creation.
Locked
Ivor Hardy

Latest python version (Nearly Solved)

Post by Ivor Hardy »

How do i go about installing the latest python version on mint. Mint 10 has version 2.6.6 installed and i need to upgrade to 3.1 for a course im doing. Also when you see programs on the net and they have versions in Linux,is it ok to download and install or can you run into problems. Thanks in advance. :mrgreen:
Last edited by LockBot on Wed Dec 28, 2022 7:16 am, edited 3 times in total.
Reason: Topic automatically closed 6 months after creation. New replies are no longer allowed.
trinux

Re: Latest python version

Post by trinux »

If you search for python in software manager or synaptic you should find what you're looking for, it looks like there's packages for 2.7 and 3.1.

As far as downloading packages from the web, in theory you can install any .deb package for your architecture, but you should be careful to download only from trusted sources. You can also compile from source, but if you knew how to do that you probably wouldn't be here asking questions ;)

Trinux
pompom

Re: Latest python version

Post by pompom »

Happy New Year and welcome to Linux Mint!

Installing the latest vanilla version of Python 3.1.3 should not take more than 5 minutes from start to finish as long as you don't need specialized libraries.

Code: Select all

mkdir /home/staging

Code: Select all

cd /home/staging

Code: Select all

wget -c http://www.python.org/ftp/python/3.1.3/Python-3.1.3.tgz

Code: Select all

tar xvzf Python-3.1.3.tgz

Code: Select all

rm Python-3.1.3.tgz (we don't need the archive anymore)

Code: Select all

cd Python-3.1.3/

Code: Select all

./configure

Code: Select all

make

Code: Select all

sudo make install
If you get any errors during the 'configure' segment, which is not very likely, it will produce error messages about missing dependencies. Python is distributed as C source file, so satisfying dependencies is quite straight forward. After you are done, you can delete the directory /home/staging since we only needed it for the build.

For the second question, the only time you might get into hot water is when installing "core" files like glibc on which everything depends. Take the extra 2 minutes and verify the MD5 hash before you install anything. The command is 'md5sum file_name'.

With kind regards,

pompom
Ivor Hardy

Re: Latest python version (Solved)

Post by Ivor Hardy »

Thanks for that pompom,that worked a treat.

Still new to this Linux lark but im learning.... :mrgreen:
Ivor Hardy

Re: Latest python version (Nearly Solved)

Post by Ivor Hardy »

Sorry to wreck everyones head but i have python installed fine but i cant get the basic programme "hello world" to work. This is it

Code: Select all

#!/usr/bin/python3.1
print ("Hello World")
input ("Press any key to exit")
I save the file as test.py to desktop,in premissions allow it executeable. When i click on it i get the option to run in terminal but then the terminal opens quickly and closes. What the hell am i missing....??? Also when i get the option to run in terminal i also get the option to just "run",this does nothing whats this for..?? :oops: :oops:
Locked

Return to “Beginner Questions”