LinuxQuestions.org
Review your favorite Linux distribution.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware
User Name
Password
Slackware This Forum is for the discussion of Slackware Linux.

Notices


Reply
  Search this Thread
Old 06-30-2022, 12:06 PM   #1
SAJM
Member
 
Registered: Nov 2012
Location: Essex UK
Distribution: Slackware 15
Posts: 269

Rep: Reputation: Disabled
Thonny not starting


I just installed Thonny using sbopkg on my laptop and it will not load.

When I click the Thoony icon on the start menu Thommy appears on the bottom of the screen for a minute then disappears.

The install went ahead with no errors.
I'm running 14.2 and a KDE Desktop.
 
Old 06-30-2022, 02:32 PM   #2
teckk
LQ Guru
 
Registered: Oct 2004
Distribution: Arch
Posts: 5,146
Blog Entries: 6

Rep: Reputation: 1834Reputation: 1834Reputation: 1834Reputation: 1834Reputation: 1834Reputation: 1834Reputation: 1834Reputation: 1834Reputation: 1834Reputation: 1834Reputation: 1834
This?
https://thonny.org/
Quote:
Thonny comes with Python 3.7 built in
Do you have different versions of python on your machine now? Did you have python installed before?

What is the output of
Code:
python
#or
python3
And what error does thonny give if run in terminal.
 
Old 06-30-2022, 03:13 PM   #3
SAJM
Member
 
Registered: Nov 2012
Location: Essex UK
Distribution: Slackware 15
Posts: 269

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by teckk View Post
This?
https://thonny.org/

Do you have different versions of python on your machine now? Did you have python installed before?

What is the output of
Code:
python
#or
python3
And what error does thonny give if run in terminal.
Here is what I got

Code:
bash-4.3$ python
Python 2.7.17 (default, Oct 20 2019, 14:16:51) 
[GCC 5.5.0] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> #or
... python3
Traceback (most recent call last):
  File "<stdin>", line 2, in <module>
NameError: name 'python3' is not defined
>>> 
KeyboardInterrupt
>>>
 
Old 06-30-2022, 03:30 PM   #4
teckk
LQ Guru
 
Registered: Oct 2004
Distribution: Arch
Posts: 5,146
Blog Entries: 6

Rep: Reputation: 1834Reputation: 1834Reputation: 1834Reputation: 1834Reputation: 1834Reputation: 1834Reputation: 1834Reputation: 1834Reputation: 1834Reputation: 1834Reputation: 1834
Ok, you have python2 installed. How about python3? It says that thonny is python3.
What does thonny in the terminal say? Is python3 in your $PATH?

Find out why thonny dies.
 
Old 06-30-2022, 05:07 PM   #5
SAJM
Member
 
Registered: Nov 2012
Location: Essex UK
Distribution: Slackware 15
Posts: 269

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by teckk View Post
Ok, you have python2 installed. How about python3? It says that thonny is python3.
What does thonny in the terminal say? Is python3 in your $PATH?

Find out why thonny dies.
I installed Python3 and it made no difference

here is my path:
Quote:
bash-4.3$ echo $PATH
/usr/local/bin:/usr/bin:/bin:/usr/games:/usr/lib64/kde4/libexec:/usr/lib64/openjdk/bin:/usr/lib64/openjdk/jre/bin:/usr/lib64/qt/bin:/usr/share/texmf/bin
bash-4.3$
 
Old 06-30-2022, 05:30 PM   #6
SAJM
Member
 
Registered: Nov 2012
Location: Essex UK
Distribution: Slackware 15
Posts: 269

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by teckk View Post
Ok, you have python2 installed. How about python3? It says that thonny is python3.
What does thonny in the terminal say? Is python3 in your $PATH?

Find out why thonny dies.
I installed Python3 and it made no difference

here is my path:
Quote:
bash-4.3$ echo $PATH
/usr/local/bin:/usr/bin:/bin:/usr/games:/usr/lib64/kde4/libexec:/usr/lib64/openjdk/bin:/usr/lib64/openjdk/jre/bin:/usr/lib64/qt/bin:/usr/share/texmf/bin
bash-4.3$
Quote:
bash-4.3# thonny
ERROR:root:Internal launch or mainloop error
Traceback (most recent call last):
File "/opt/thonny/__init__.py", line 49, in launch
from thonny import workbench
File "/opt/thonny/workbench.py", line 14, in <module>
import tkinter as tk
File "/usr/lib64/python3.7/tkinter/__init__.py", line 36, in <module>
import _tkinter # If this fails your Python may not be configured for Tk
ModuleNotFoundError: No module named '_tkinter'
Traceback (most recent call last):
File "/opt/thonny/__init__.py", line 49, in launch
from thonny import workbench
File "/opt/thonny/workbench.py", line 14, in <module>
import tkinter as tk
File "/usr/lib64/python3.7/tkinter/__init__.py", line 36, in <module>
import _tkinter # If this fails your Python may not be configured for Tk
ModuleNotFoundError: No module named '_tkinter'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "/usr/lib64/python3.7/runpy.py", line 193, in _run_module_as_main
"__main__", mod_spec)
File "/usr/lib64/python3.7/runpy.py", line 85, in _run_code
exec(code, run_globals)
File "/opt/thonny/__main__.py", line 18, in <module>
launch()
File "/opt/thonny/__init__.py", line 83, in launch
from thonny import ui_utils
File "/opt/thonny/ui_utils.py", line 13, in <module>
import tkinter as tk
File "/usr/lib64/python3.7/tkinter/__init__.py", line 36, in <module>
import _tkinter # If this fails your Python may not be configured for Tk
ModuleNotFoundError: No module named '_tkinter'
bash-4.3#
 
Old 06-30-2022, 10:54 PM   #7
SAJM
Member
 
Registered: Nov 2012
Location: Essex UK
Distribution: Slackware 15
Posts: 269

Original Poster
Rep: Reputation: Disabled
python3 seemed to install OK with no errors however it clearly has not installed.
What would stop it being installed yet bring up no errors?

Quote:
bash-4.3$ python
Python 2.7.17 (default, Oct 20 2019, 14:16:51)
[GCC 5.5.0] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> #or
... python3
Traceback (most recent call last):
File "<stdin>", line 2, in <module>
NameError: name 'python3' is not defined
>>>
and

Quote:
bash-4.3# slackpkg search python

Looking for python in package list. Please wait... DONE

The list below shows all packages with name matching "python".

[ installed ] - python-2.7.17-x86_64-1_slack14.2
[ installed ] - python-setuptools-22.0.5-x86_64-1
[ installed ] - kdev-python-1.7.2-x86_64-1
[ installed ] - dbus-python-1.2.4-x86_64-1
[ installed ] - notify-python-0.1.1-x86_64-5
[ installed ] - python-pillow-3.0.0-x86_64-1

You can search specific files using "slackpkg file-search file".


bash-4.3#
 
Old 06-30-2022, 11:03 PM   #8
SAJM
Member
 
Registered: Nov 2012
Location: Essex UK
Distribution: Slackware 15
Posts: 269

Original Poster
Rep: Reputation: Disabled
....however if I ls packages, python3-3.7.2-x86_64-1_SBo is listed.
 
Old 06-30-2022, 11:31 PM   #9
pan64
LQ Addict
 
Registered: Mar 2012
Location: Hungary
Distribution: debian/ubuntu/suse ...
Posts: 21,982

Rep: Reputation: 7337Reputation: 7337Reputation: 7337Reputation: 7337Reputation: 7337Reputation: 7337Reputation: 7337Reputation: 7337Reputation: 7337Reputation: 7337Reputation: 7337
you need to start python3 with the command python3 (instead of python, which defaults to python2).
I don't really know how did you try to start thonny, but probably
Code:
pip3 install thonny
thonny
or something similar will work. But probably you need to install tkinter (python3-tk) too.
 
Old 07-01-2022, 12:32 AM   #10
SAJM
Member
 
Registered: Nov 2012
Location: Essex UK
Distribution: Slackware 15
Posts: 269

Original Poster
Rep: Reputation: Disabled
Interesting that Tkinter is not included in sbopkg or slackpkg - is that telling me something?
 
Old 07-01-2022, 05:03 AM   #11
SAJM
Member
 
Registered: Nov 2012
Location: Essex UK
Distribution: Slackware 15
Posts: 269

Original Poster
Rep: Reputation: Disabled
Code:
pip3 install thonny
thonny
result

Code:
bash-4.3# pip3 install thonny > thonny.txt
You are using pip version 18.1, however version 22.1.2 is available.
You should consider upgrading via the 'pip install --upgrade pip' command.
bash-4.3# thonny
INFO    thonny: Thonny version: 3.3.14
Traceback (most recent call last):
  File "/usr/bin/thonny", line 11, in <module>
    sys.exit(launch())
  File "/usr/lib64/python3.7/site-packages/thonny/__init__.py", line 178, in launch
    if not _check_welcome():
  File "/usr/lib64/python3.7/site-packages/thonny/__init__.py", line 146, in _check_welcome
    from thonny.config import ConfigurationManager
  File "/usr/lib64/python3.7/site-packages/thonny/config.py", line 9, in <module>
    import tkinter as tk
  File "/usr/lib64/python3.7/tkinter/__init__.py", line 36, in <module>
    import _tkinter # If this fails your Python may not be configured for Tk
ModuleNotFoundError: No module named '_tkinter'
bash-4.3#
 
Old 07-01-2022, 06:05 AM   #12
SAJM
Member
 
Registered: Nov 2012
Location: Essex UK
Distribution: Slackware 15
Posts: 269

Original Poster
Rep: Reputation: Disabled
I dont get it
On KDE nothing loads
No Python2, no Python3 and no Thonny

On the treminal both Python 2 & 3 open

Thonny does not.

I wish I knew what this means:
Quote:
bash-4.3# thonny
INFO thonny: Thonny version: 3.3.14
Traceback (most recent call last):
File "/usr/bin/thonny", line 11, in <module>
sys.exit(launch())
File "/usr/lib64/python3.7/site-packages/thonny/__init__.py", line 178, in launch
if not _check_welcome():
File "/usr/lib64/python3.7/site-packages/thonny/__init__.py", line 146, in _check_welcome
from thonny.config import ConfigurationManager
File "/usr/lib64/python3.7/site-packages/thonny/config.py", line 9, in <module>
import tkinter as tk
File "/usr/lib64/python3.7/tkinter/__init__.py", line 36, in <module>
import _tkinter # If this fails your Python may not be configured for Tk
ModuleNotFoundError: No module named '_tkinter'
bash-4.3#
 
Old 07-01-2022, 08:16 AM   #13
teckk
LQ Guru
 
Registered: Oct 2004
Distribution: Arch
Posts: 5,146
Blog Entries: 6

Rep: Reputation: 1834Reputation: 1834Reputation: 1834Reputation: 1834Reputation: 1834Reputation: 1834Reputation: 1834Reputation: 1834Reputation: 1834Reputation: 1834Reputation: 1834
Quote:
ModuleNotFoundError: No module named '_tkinter'
You probably don't have tk/tcl installed. tkinter uses that.

Start with some basics.

In a terminal, can you open a python3 shell. You already established that you have python2 working.(post3-7)

Find out where python3 is. And if your shell have a PATH to the executable. Looks like it does.

Example: (arch)
Code:
python
Python 3.10.5 (main, Jun  6 2022, 18:49:26) [GCC 12.1.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>>
Code:
which python
/usr/bin/python
Until you have a working python3, nothing will work.

Then in the working python3 shell
Code:
python
Python 3.10.5 (main, Jun  6 2022, 18:49:26) [GCC 12.1.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import tkinter
>>>
If you get an error, you'll need to fix it. What is the error to that?

In python2 it was Tkinter, in python3 it is tkinter.

Edit:
You need to troubleshoot this a step at a time.

Last edited by teckk; 07-01-2022 at 08:17 AM.
 
Old 07-01-2022, 08:17 AM   #14
BrunoLafleur
Member
 
Registered: Apr 2020
Location: France
Distribution: Slackware
Posts: 405

Rep: Reputation: 369Reputation: 369Reputation: 369Reputation: 369
Quote:
Originally Posted by SAJM View Post
I dont get it
On KDE nothing loads
No Python2, no Python3 and no Thonny

On the treminal both Python 2 & 3 open

Thonny does not.

I wish I knew what this means:
It means that the python3 interface for TK is missing.

Maybe python3 was compiled without TK support.

So it seems it could be installed with :

> pip3 install tk
 
Old 07-01-2022, 08:26 AM   #15
teckk
LQ Guru
 
Registered: Oct 2004
Distribution: Arch
Posts: 5,146
Blog Entries: 6

Rep: Reputation: 1834Reputation: 1834Reputation: 1834Reputation: 1834Reputation: 1834Reputation: 1834Reputation: 1834Reputation: 1834Reputation: 1834Reputation: 1834Reputation: 1834
Here is the source. Which is where you would first look, if you are trying to build something.
https://github.com/thonny/thonny

Look at the error in post #12
Code:
File "/usr/lib64/python3.7/site-packages/thonny/config.py", line 9, in <module>
import tkinter as tk

File "/usr/lib64/python3.7/tkinter/__init__.py", line 36, in <module>

File "/usr/lib64/python3.7/tkinter/__init__.py", line 36, in <module>
import _tkinter # If this fails your Python may not be configured for Tk
ModuleNotFoundError: No module named '_tkinter'
That would be here
https://github.com/thonny/thonny/blo...onny/config.py

And here
https://github.com/thonny/thonny/blo...ny/__init__.py

You don't have tkinter working. Start with fixing that. Show what eroors you are getting step by step. Or you will never get anywhere.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
LXer: Learn to code with Thonny -- a Python IDE for beginners LXer Syndicated Linux News 0 02-19-2018 05:21 AM
When Centos 6.3 starting,All services starting OK and starting Atd: OK .And stop scr. DeSouffle Linux - General 4 08-29-2013 12:46 AM
[SOLVED] Starting File System .. Starting File System .. Starting File System .. Starting File rmknox Linux - Newbie 3 08-15-2010 11:30 PM
Starting apps after starting xfce?? gtgoku Slackware 2 08-21-2004 01:49 PM
starting kpppd w/ ximian or starting ximian w/ kde ergo_sum Linux - Newbie 8 12-02-2003 05:35 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware

All times are GMT -5. The time now is 12:24 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration