English
Ask Your Question
1

Can't run Python3 IDLE in Fedora 16

asked 2011-11-11 14:04:20 +0000

ThE1OnE gravatar image

updated 2011-12-03 20:55:45 +0000

mether gravatar image

Hi guys,

I want to run Python's IDLE. Python3 and python-tools are already installed. When I run python /usr/lib/python3.2/idlelib/PyShell.py it gives me this error:

Traceback (most recent call last): File "<string>", line 1, in <module> ImportError: No module named run

How can I fix this? Thank you!

edit retag flag offensive close merge delete

2 answers

Sort by ยป oldest newest most voted
0

answered 2011-11-11 14:29:03 +0000

asto gravatar image

Create a file /usr/bin/idle3 with these contents

#!/usr/bin/python3

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

Then

# su -c 'chmod +x /usr/bin/idle3'

Now all you have to do is enter "idle3" at the command line and idle will start up on python3

You might have to also do this if you get an error about tkinter

# su -c 'yum -y install python3-tkinter'
edit flag offensive delete link more
1

answered 2012-10-08 18:10:07 +0000

Which version of python3-tools were you using?

Note that "python" in Fedora means Python 2; running

python /usr/lib/python3.2/idlelib/PyShell.py

is erroneous, since it's attempting to run Python 3 code with the Python 2 interpreter. There are enough differences between the versions of Python that there's no guarantee that that Python 3 script is even syntactically valid Python 2 code.

To run IDLE for Python 3, python3-tools provides a /usr/bin/idle3.2 for Python 3.2 (or 3.3 for Fedora 18 onwards). This has the content:

#!/usr/bin/python3.2

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

though you shouldn't need to know that; it's packaged as part of the rpm.

So you should simply run:

$ idle3.2

and it should have just worked.

Should there be a "/usr/bin/idle3" as well?

Hope this is helpful

edit flag offensive delete link more

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

[hide preview]

Use your votes!

  • Use the 30 daily voting points that you get!
  • Up-vote well framed questions that provide enough information to enable people provide answers.
  • Thank your helpers by up-voting their comments and answers. If a question you asked has been answered, accept the best answer by clicking on the checkbox on the left side of the answer.
  • Down-voting might cost you karma, but you should consider doing so for incorrect or clearly detrimental questions and answers.

Question Tools

Follow
1 follower

Stats

Asked: 2011-11-11 14:04:20 +0000

Seen: 4,194 times

Last updated: Oct 08 '12