0

I currently use python 3.2.3 in the IDLE (which I open from 'python 3', 'programming', 'menu') on my Raspberry Pi. In an attempt to solve this problem I am trying to get my IDLE to run python 3.5.

I have got Python 3.5 to run if I enter into the terminal

python3

but the IDLE still uses Python 3.2.3

Any thoughts?


EDIT: I realise it is actually a duplicate to this question, but because the asker didn't specify that they wanted the IDLE version, the answerers didn't answer the question how it was intended.

Community
  • 1
  • 1
Tom Burrows
  • 2,225
  • 2
  • 29
  • 46

1 Answers1

0

This is because Raspbian (or whatever OS you're using) depends on those pre-installed versions of Python and later versions are not available via apt-get for good reason.

Edit:

I see you've already got Python 3.5 installed. To get IDLE to use the appropriate version, you need to set IDLE to use that version of Python by changing the shebang line in the IDLE-python file. This is probably located somewhere like /usr/bin/idle-python3.2

The contents of the file will look something like this:

#! /usr/bin/python3.2

from idlelib.PyShell import main
if __name__ == '__main__':
    main()

So you should edit it to the version you'd like to use defaultly.

#! /usr/bin/python3.5

from idlelib.PyShell import main
if __name__ == '__main__':
    main()

Alternatively, make an additional IDLE that points to 3.5

sytech
  • 29,298
  • 3
  • 45
  • 86
  • Because apt would have the potential to replace the version of python that Raspbian is depending on. Other reasons might be that they just haven't come around to making and testing a stable build for raspbian. – sytech Oct 11 '16 at 17:33
  • Tried editing it as suggested, but gives I/O Error Permission Denied – Tom Burrows Oct 11 '16 at 17:56
  • You should try calling up your editor with root permissions for example: `sudo nano /usr/bin/idle-python3.2` – sytech Oct 11 '16 at 17:58
  • Hmm... I'be never tried that before... It opened the file and I did the edit, but I couldn't work out how to do anything else (like save it) so I closed the terminal. Going back to the idle-python3.2 file, nothing has changed, but it created a new file called 'idle-python3.2.save'. – Tom Burrows Oct 11 '16 at 18:24
  • In the nano editor, you do `ctrl+o` to write to the file. You can use any editor, but you need to use it with root privileges. – sytech Oct 11 '16 at 19:25
  • I have edited the file, and it definitely says 3.5, but when I open up the IDLE it still says 3.2 :( – Tom Burrows Oct 11 '16 at 20:02
  • Let us [continue this discussion in chat](http://chat.stackoverflow.com/rooms/125448/discussion-between-gloin-and-gator-python). – Tom Burrows Oct 11 '16 at 20:16