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.
I just installed Thonny using sbopkg on my laptop and it will not load.
Quote:
Originally Posted by SAJM
I'm running 14.2 and a KDE Desktop.
How exactly did you install it? Please describe the exact sequence of actions that you performed. Did you just start sbopkg, searched for "thonny", then installed it? If so, it's very likely that it's the wrong way to do it, in either 14.2 or 15.0. If you go to the corresponding page on SBo http://slackbuilds.org/repository/14.2/python/thonny/ you will see that it has build dependencies. Hence, you need to generate the queue file for it:
Code:
# sqg -p thonny
Then start sbopkg, load the queue for thonny and install all the packages, as in both thonny and its dependencies.
Quote:
Originally Posted by SAJM
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
>>>
This proves that you just blindly copypasted the whole without thinking. You were supposed to do
Code:
bash-4.3$ python3
after you did
Code:
bash-4.3$ python
First would check the default python version, second would explicitly check if you have python3
Quote:
Originally Posted by SAJM
I installed Python3
Again, no details about how exactly did you install Python3. And this probably implies that you did not have it already installed for something else before thonny. Then that probably you didn't go through the queue file workflow mentioned above, otherwise python3 would've been installed when you ran the queue for thonny in sbopkg.
Quote:
Originally Posted by pan64
I don't really know how did you try to start thonny, but probably
Code:
pip3 install thonny
thonny
or something similar will work.
IMHO suggesting to install software provided by SBo via pip to somebody who's not very experienced (see my copypaste comment above) will only add more confusion. Your example command will work as root, mixing stuff installed for python3 via sbopkg from SBo and software for the same python3 installed directly via pip, which is a VERY bad thing. It's possible to install things via pip as regular user, but then the pip command requires an additional --user command line argument. Yet I'm not sure using pip is needed, as I said above.
Quote:
Originally Posted by pan64
But probably you need to install tkinter (python3-tk) too.
Oh please, this is Slackware, not Debian. It doesn't split python into multiple packages, adding even more confusion. If python3 was installed correctly, via the SBo script for 14.2, it contains tk, just like the vanilla python2 package. Lack of tk in python3 means that probably python3 was installed differently, hence I asked OP above to provide more details.
Quote:
Originally Posted by BrunoLafleur
Maybe python3 was compiled without TK support.
So it seems it could be installed with :
> pip3 install tk
Please, stop suggesting pip in this context. Slackware 14.2 was the stable version for many years. You don't imagine SBo shipped python3 with no tk, considering that vanilla python2 in Slackware doesn't split the python package? See above.
Did you just start sbopkg, searched for "thonny", then installed it?
That's exactly what I did. It seemed logical and has worked in the past.
I always understood the dependencies were all installed as a package when using sbopkg
I removed Python3 and reinstalled it paying particular attention to the output. It was very fast but I did see mention of tk flash past but it still was not installed
You are new to python. You are going to have an impossible time, unless you start at step one, then 2...
Arch calls python3 python, Slack might call that python3. It's your box, find out.
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
>>> help(tkinter)
...
Help on package tkinter:
NAME
tkinter - Wrapper functions for Tcl/Tk.
MODULE REFERENCE
https://docs.python.org/3.10/library/tkinter.html
The following documentation is automatically generated from the Python
source files. It may be incomplete, incorrect or include features that
are considered implementation detail and may vary between Python
implementations. When in doubt, consult the module reference at the
location listed above.
DESCRIPTION
Tkinter provides classes which allow the display, positioning and
control of widgets. Toplevel widgets are Tk and Toplevel. Other
widgets are Frame, Label, Entry, Text, Canvas, Button, Radiobutton,
Checkbutton, Scale, Listbox, Scrollbar, OptionMenu, Spinbox
LabelFrame and PanedWindow.
Properties of the widgets are specified with keyword arguments.
Keyword arguments have the same name as the corresponding resource
That's exactly what I did. It seemed logical and has worked in the past.
I suppose by "in the past" you rather mean "for other software". This indeed works. For software with no build dependencies. For software with build dependencies, you need to install them explicitly yourself, even if you use sbopkg. Or make use of queues, as I explained above.
Quote:
Originally Posted by SAJM
I always understood the dependencies were all installed as a package when using sbopkg
After you get/have python3 working, tk/tcl installed so that tkinter will work...
Here is a simple little test script to see if all is well, with tkinter.
test.py
[
Code:
python3 ./test.py
Result:
[CODE}
bash-4.3$ python3 ./test.py
Traceback (most recent call last):
File "./test.py", line 3, in <module>
from tkinter import *
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$
[/CODE]
EDIT
oops I just noticed I should have run this after the Tk issue was resolved!!
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.