SlackwareThis Forum is for the discussion of Slackware Linux.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
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
>>>
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#
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".
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.
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#
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#
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.
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'
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.