0

I am new to the Raspberry Pi, I have a project. I would like to work on Python 2 not Python 3.

By default Python 3 is installed on my Pi. I want to change or remove this version and I want to install Python version 2. the exact version does not matter, e.g. 2.7 or 2.9..etc.

Also I want to see Python version 2 on the menu in the programming list.

How do I do this?

  • Why do you want python 2? It would be more sensible to convert to python 3. – CoderMike Dec 2 '18 at 17:24
  • i have some libraries and ready code in python 2. – Abdo Abdi Dec 2 '18 at 17:28
  • 1
    Support for Python 2 ends 31.12.2019 pythonclock.org – ben_nuttall Mar 7 at 11:22
2

Idle 2 is installed but on recent Raspbian images Python v2 menu entries are disabled.

To activate it start the 'Main Menu Editor' from the Preferences menu. Select 'Programming' on the left. After activating 'Python 2 IDLE' you should be able to start Idle 2 from the menu.

You may need to install the 'Main Menu Editor' program. For this use e.g.

sudo apt update
sudo apt install alacarte
1

You say you are using raspbian-stretch. With this and with most debian derivate you have python 2.7 installed. This is because the Debian operating system itself needs this version for its scripts to run. It is for historical reasons and because the maintainers haven't got it to upgrade all OS scripts to Python 3. I think they will do by time. If you call python (the default) - not python3 - on the command line you will run version 2.7. Check with

rpi ~$ python --version
Python 2.7.13

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.