pierrot10
Posts: 30
Joined: Mon Dec 15, 2014 3:17 pm

What sould I do with Python version

Sun Feb 18, 2018 1:29 am

Hello

Oft, when I am wolring with a Ubuntu (and now with Raspberry), I observed that Python 2.7 is installed.

For exemple, on my Raspbery Zero, I entered the following commande

Code: Select all

python --version
Python 2.7.13
I would like to use the luma.oled library https://luma-oled.readthedocs.io/en/latest/install.html which has been developped for
Python 2.7, 3.4, 3.5 and 3.6.

Now, I wonder if I should continue using Python 2.7 and why the latest version of Python is not installed.

Then how can I migrate to Python 3.6? Should I?

I could continue with Python 2.7 but it make more sense to use the latest version, isn't?

Cheers

User avatar
KLL
Posts: 1453
Joined: Wed Jan 09, 2013 3:05 pm
Location: thailand
Contact: Website

Re: What sould I do with Python version

Sun Feb 18, 2018 2:14 am

on a updated ( full desktop version) RASPIAN ( on a RPI3 ) i see

Code: Select all

pi@RPI3:~ $ python --version
Python 2.7.13
pi@RPI3:~ $ python3 --version
Python 3.5.3
so you are free to choose

asandford
Posts: 1998
Joined: Mon Dec 31, 2012 12:54 pm
Location: Waterlooville

Re: What sould I do with Python version

Sun Feb 18, 2018 2:18 am

pierrot10 wrote:
Sun Feb 18, 2018 1:29 am
Hello

Oft, when I am wolring with a Ubuntu (and now with Raspberry), I observed that Python 2.7 is installed.

For exemple, on my Raspbery Zero, I entered the following commande

Code: Select all

python --version
Python 2.7.13
I would like to use the luma.oled library https://luma-oled.readthedocs.io/en/latest/install.html which has been developped for
Python 2.7, 3.4, 3.5 and 3.6.

Now, I wonder if I should continue using Python 2.7 and why the latest version of Python is not installed.

Then how can I migrate to Python 3.6? Should I?

I could continue with Python 2.7 but it make more sense to use the latest version, isn't?

Cheers
There are two different versions of python; the 2.7.x version, and the 3.x version.

pierrot10
Posts: 30
Joined: Mon Dec 15, 2014 3:17 pm

Re: What sould I do with Python version

Sun Feb 18, 2018 10:58 am

Ok, then if I start a project and I need to download a library, as fro example luma.oled.

Do I have to install it with

Code: Select all

$ sudo apt-get install python-dev python-pip libfreetype6-dev libjpeg-dev build-essential
$ sudo -H pip install --upgrade luma.oled
the the library will be available for Pyton 2.7 and 3.x?

or should I repeat the install for Python 3

Code: Select all

$ sudo apt-get install python3-dev python3-pip libfreetype6-dev libjpeg-dev build-essential
$ sudo -H pip3 install --upgrade luma.oled
I also heard, it better to start with Python 2.7 and then Python 3.x to better understand the difference, but Python 2.7 will not be depreciate soon?

User avatar
DougieLawson
Posts: 32687
Joined: Sun Jun 16, 2013 11:19 pm
Location: Basingstoke, UK
Contact: Website

Re: What sould I do with Python version

Sun Feb 18, 2018 12:12 pm

All new code should be written in python3. As a new user forget python 2 ever existed.
Microprocessor, Raspberry Pi & Arduino Hacker
Mainframe database troubleshooter
MQTT Evangelist
Twitter: @DougieLawson

2012-18: 1B*5, 2B*2, B+, A+, Z, ZW, 3Bs*3, 3B+

Any DMs sent on Twitter will be answered next month.

Return to “Beginners”

Who is online

Users browsing this forum: No registered users and 30 guests