Monday, April 29, 2024
6
rated 0 times [  6] [ 0]  / answers: 1 / hits: 5000  / 2 Years ago, fri, march 11, 2022, 2:10:32

I have just installed ubuntu 3.10 and, although this version is still reliant on python 2 as the default, the python 3.3 interpreter is listed as installed in the software centre. Does this mean that python 3.3 is already here somewhere, and if so how do I access it to run my code?



I know there are many questions about installing python 3.3 alongside 2.7.x in Ubuntu (and definitely not replacing it!), but it seems to be already installed. However, in terminal I get 2.7.5 when I type 'python' and the online documentation says that it was not possible to break the reliance on python 2 for this ubuntu release. I was expecting to have to install it in a different directory, but if this has already been done then I could avoid messing with a critical bit of ubuntu.



Thanks for your help!


More From » installation

 Answers
2

If you want to use Python 3, run python3 instead of just python. You can also use Python 3 for your scripts, if you add



#!/usr/bin/env python3


as the first line.


[#28263] Sunday, March 13, 2022, 2 Years  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.
whoppinolo

Total Points: 93
Total Questions: 113
Total Answers: 107

Location: Cyprus
Member since Mon, Oct 24, 2022
2 Years ago
whoppinolo questions
Tue, Feb 14, 23, 08:30, 1 Year ago
Wed, Sep 28, 22, 06:56, 2 Years ago
Fri, May 27, 22, 01:55, 2 Years ago
Tue, Oct 12, 21, 09:33, 3 Years ago
;