Raymondo02
Posts: 8
Joined: Thu Apr 18, 2019 11:48 pm

problem with python program

Mon Jul 08, 2019 12:44 am

Hello,
I installed the last version of rasbian on my Raspberry pi 3 B+. I check in the programming section and the Python IDLE is not there. I need this to continu my project. So how can I have it back?

User avatar
rpiMike
Posts: 1391
Joined: Fri Aug 10, 2012 12:38 pm
Location: Cumbria, UK

Re: problem with python program

Mon Jul 08, 2019 4:59 am

Have you tried Thonny, much better than IDLE.

User avatar
B.Goode
Posts: 10356
Joined: Mon Sep 01, 2014 4:03 pm
Location: UK

Re: problem with python program

Mon Jul 08, 2019 5:39 am

Raymondo02 wrote:
Mon Jul 08, 2019 12:44 am
Hello,
I installed the last version of rasbian on my Raspberry pi 3 B+. I check in the programming section and the Python IDLE is not there. I need this to continu my project. So how can I have it back?


Probably part of consistent moves by Raspberry Pi to wean you off the Python2 dialect of the language which reaches End of Life at the end of this year.

The menu item was removed in a release of Raspbian 12 months ago.

In the June 2019 release the IDLE IDE itself has been removed.

I believe the underlying Python2 interpreter is still installed by default, so your ability to develop and run python code is unaffected.

So to continue to use the Python2 version of IDLE you will need to reinstall the program itself as well as reinstating the menu item.

Maybe simpler to just make the move to Python3? And you might find that the Thonny Python editor is nicer to use. (The Mu python editor is also worth investigating, but is not a default Installation in Raspbian yet.)

Raymondo02
Posts: 8
Joined: Thu Apr 18, 2019 11:48 pm

Re: problem with python program

Mon Jul 08, 2019 11:29 am

Thank you, I try Thonny and I like it.

But I have another problem. In my program, I use GPIO. So, I write at the beginning : import RPi.GPIO as GPIO. When I run it, I receive ModuleNotFoundError : No module named 'RPi'.

I already download the GPIO module. So, how I fix that ?

User avatar
DougieLawson
Posts: 39301
Joined: Sun Jun 16, 2013 11:19 pm
Location: A small cave in deepest darkest Basingstoke, UK
Contact: Website Twitter

Re: problem with python program

Mon Jul 08, 2019 11:42 am

Do you have both python-rpi-gpio and python3-rpi-gpio installed.

It really would be better if you ditched python2 and stuck to python3.
Note: Any requirement to use a crystal ball or mind reading will result in me ignoring your question.

Criticising any questions is banned on this forum.

Any DMs sent on Twitter will be answered next month.
All non-medical doctors are on my foes list.

gordon77
Posts: 5075
Joined: Sun Aug 05, 2012 3:12 pm

Re: problem with python program

Mon Jul 08, 2019 12:17 pm

rpiMike wrote:
Mon Jul 08, 2019 4:59 am
Have you tried Thonny, much better than IDLE.
Thonny won't work with large python scripts.

You can install idle and use it. sudo apt install idle

User avatar
rpiMike
Posts: 1391
Joined: Fri Aug 10, 2012 12:38 pm
Location: Cumbria, UK

Re: problem with python program

Mon Jul 08, 2019 12:29 pm

gordon77 wrote:
Mon Jul 08, 2019 12:17 pm
rpiMike wrote:
Mon Jul 08, 2019 4:59 am
Have you tried Thonny, much better than IDLE.
Thonny won't work with large python scripts.

You can install idle and use it. sudo apt install idle
Have you reported that as an issue?

https://github.com/thonny/thonny/issues

gordon77
Posts: 5075
Joined: Sun Aug 05, 2012 3:12 pm

Re: problem with python program

Mon Jul 08, 2019 7:28 pm

rpiMike wrote:
Mon Jul 08, 2019 12:29 pm
gordon77 wrote:
Mon Jul 08, 2019 12:17 pm
rpiMike wrote:
Mon Jul 08, 2019 4:59 am
Have you tried Thonny, much better than IDLE.
Thonny won't work with large python scripts.

You can install idle and use it. sudo apt install idle
Have you reported that as an issue?

https://github.com/thonny/thonny/issues
Reported it now. Loading my script of 5900 lines takes 4 minutes 50 seconds !!. IDLE or Geany take about 1 second.
I don't mind if its meant for beginners with small scripts, BUT don't take IDLE off the standard build in favour of Thonny.

gordon77
Posts: 5075
Joined: Sun Aug 05, 2012 3:12 pm

Re: problem with python program

Wed Jul 10, 2019 3:23 pm

I got a reply.. It wasn't intended for large python scripts but should improve...

https://github.com/thonny/thonny/issues/800

User avatar
rpiMike
Posts: 1391
Joined: Fri Aug 10, 2012 12:38 pm
Location: Cumbria, UK

Re: problem with python program

Wed Jul 10, 2019 3:40 pm

Great to see they are looking into your issue and finding improvements.

I have to ask why have you not broken your code into smaller files?

gordon77
Posts: 5075
Joined: Sun Aug 05, 2012 3:12 pm

Re: problem with python program

Wed Jul 10, 2019 3:42 pm

Because previously it wasn't a problem. :D

Return to “Python”