WelcomeWelcome | FAQFAQ | DownloadsDownloads | WikiWiki

Author Topic: python  (Read 602 times)

Offline giaco_fab

  • Newbie
  • *
  • Posts: 6
python
« on: September 28, 2020, 11:43:17 PM »
Hi

Tkinter doesn't works request libtk8.6.so that seems to be missing
libtk8.5.so is present

Also python for raspberry is updated to 3.8 but the one for "desktop" is still at 3.6 version


Online Juanito

  • Administrator
  • Hero Member
  • *****
  • Posts: 12642
Re: python
« Reply #1 on: September 29, 2020, 01:00:53 AM »
Which version and which architecture are you speaking of - piCore-11.x?

If so, are you using the python extension from piCore-9.x or the python2.7 extension from piCore-11.x?

Offline giaco_fab

  • Newbie
  • *
  • Posts: 6
Re: python
« Reply #2 on: September 29, 2020, 02:43:56 AM »
piCore-11.0.zip on raspberry

Core-11.1.iso on virtualbox

I downloaded python with tce-load -w ... I don't know which ones it downloaded  ;D
 

Online Juanito

  • Administrator
  • Hero Member
  • *****
  • Posts: 12642
Re: python
« Reply #3 on: September 29, 2020, 05:15:33 AM »
piCore-11.x has python extensions named python2.7 and python3.8

Core-11.x has python extensions named python and python3.6

Can you give more details about the error messages you get with tkinter on Core and "desktop" on piCore?

Offline giaco_fab

  • Newbie
  • *
  • Posts: 6
Re: python
« Reply #4 on: September 30, 2020, 11:11:08 AM »
error attached

Same error on both versions

Online Juanito

  • Administrator
  • Hero Member
  • *****
  • Posts: 12642
Re: python
« Reply #5 on: October 01, 2020, 01:06:36 AM »
Was the tk8.6 extension loaded (tk in piCore)?

Online Juanito

  • Administrator
  • Hero Member
  • *****
  • Posts: 12642
Re: python
« Reply #6 on: October 01, 2020, 01:38:38 AM »
This opens a window:
Code: [Select]
$ tce-load -i python tk8.6
$ python
>>> import sys
>>> import Tkinter as tk
>>> root = tk.Tk()

Offline giaco_fab

  • Newbie
  • *
  • Posts: 6
Re: python
« Reply #7 on: October 01, 2020, 01:43:56 AM »
oh my god  :-[

tk is for python2
tk8.6 for python 3
?

Sorry :-[




Online Juanito

  • Administrator
  • Hero Member
  • *****
  • Posts: 12642
Re: python
« Reply #8 on: October 01, 2020, 01:48:56 AM »
No, tk8.6 works with both python(2.7) and python3.6 in x86:
Code: [Select]
$ tce-load -i python3.6 tk8.6
$ python3.6
>>> import sys
>>> import tkinter as tk
>>> root = tk.Tk()
« Last Edit: October 01, 2020, 01:51:08 AM by Juanito »

Offline giaco_fab

  • Newbie
  • *
  • Posts: 6
Re: python
« Reply #9 on: October 01, 2020, 02:15:58 AM »
sorry but...
now it works on desktop
tk8.6 seems to not be present for raspberry ??
 http://tinycorelinux.net/11.x/armv6/tcz/
I searched for tk8.6 for armv6 witout founding it at the beginning  ;D
it says no module named _tkinter on rpi
it may be not configured for tk




« Last Edit: October 01, 2020, 02:29:33 AM by giaco_fab »

Online Juanito

  • Administrator
  • Hero Member
  • *****
  • Posts: 12642
Re: python
« Reply #10 on: October 01, 2020, 02:31:00 AM »
In the piCore-11.x repo the extensions are called python2.7 and tk.

Online Juanito

  • Administrator
  • Hero Member
  • *****
  • Posts: 12642
Re: python
« Reply #11 on: October 01, 2020, 02:46:52 AM »
I just checked piCore and it looks like you are right:
Code: [Select]
$ tce-load -i python2.7 tk
$ python2.7
>>> import sys
>>> import Tkinter as tk
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/usr/local/lib/python2.7/lib-tk/Tkinter.py", line 39, in <module>
    import _tkinter # If this fails your Python may not be configured for Tk
ImportError: No module named _tkinter

Offline giaco_fab

  • Newbie
  • *
  • Posts: 6
Re: python
« Reply #12 on: October 01, 2020, 03:29:43 AM »
okkk
I started thought i'm stupid  ;D

python3.8 on picore (I need to use 3.x) has same problem

A question if possible:
I tied to compile using :
http://tinycorelinux.net/11.x/x86/tcz/src/python3.6/compile_python3.6
but I get an error on this two lines
edit setup.py
curses_includes.append('/usr/local/include/ncursesw')
what is missing ? How to get it



Online Juanito

  • Administrator
  • Hero Member
  • *****
  • Posts: 12642
Re: python
« Reply #13 on: October 01, 2020, 03:36:54 AM »
The ncurses headers (ncurses-dev extension) are in /usr/local/include in piCore.