Tiny Core Linux
Tiny Core Extensions => TCE Talk => Topic started by: giaco_fab on September 29, 2020, 02:43:17 AM
-
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
-
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?
-
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
-
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?
-
error attached
Same error on both versions
-
Was the tk8.6 extension loaded (tk in piCore)?
-
This opens a window:
$ tce-load -i python tk8.6
$ python
>>> import sys
>>> import Tkinter as tk
>>> root = tk.Tk()
-
oh my god :-[
tk is for python2
tk8.6 for python 3
?
Sorry :-[
-
No, tk8.6 works with both python(2.7) and python3.6 in x86:
$ tce-load -i python3.6 tk8.6
$ python3.6
>>> import sys
>>> import tkinter as tk
>>> root = tk.Tk()
-
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
-
In the piCore-11.x repo the extensions are called python2.7 and tk.
-
I just checked piCore and it looks like you are right:
$ 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
-
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
-
The ncurses headers (ncurses-dev extension) are in /usr/local/include in piCore.
-
hello there,
i have the same problem with piCore 13.x/armv7
i cant find tk8.6 and i am getting "import _tkinter # If this fails your Python may not be configured for Tk"
how do fix that ?
THx
-
Hi Rabie
Isn't this it:
http://tinycorelinux.net/13.x/armv7/tcz/tk.tcz.info
-
Hi Rich,
i did install the tk.tcz and the tcl.tcz and i am getting this error anyway
I tried with python2.7, python3.8 and python3.9 is the same
I did try to reinstall python but without success.
On Tinycore V.10 i didn't have this Problem but there was the tk8.6 and tcl8.6.tcz
What can also try ?
Thx
-
Does python have a file with a name similar to /usr/local/lib/python3.6/lib-dynload/_tkinter.cpython-36m-x86_64-linux-gnu.so?
-
As per the *tcz.list files in piCore-13.x armv7, python2.7, python3.8 and python3.9 do not contain _tkinter*.so, so I would guess (I may be wrong) that they were not compiled against tk.
-
Hi Rabie
... On Tinycore V.10 i didn't have this Problem but there was the tk8.6 and tcl8.6.tcz ...
That sounds like you are talking about x86:
http://tinycorelinux.net/10.x/x86/tcz/tcl8.6.tcz.info
or x86_64:
http://tinycorelinux.net/10.x/x86_64/tcz/tcl8.6.tcz.info
TC10 for ARM only has version 8.7a1:
http://tinycorelinux.net/10.x/armv7/tcz/tcl.tcz.info
-
Does python have a file with a name similar to /usr/local/lib/python3.6/lib-dynload/_tkinter.cpython-36m-x86_64-linux-gnu.so?
Hi Juanito,
no, this is all i can find with the command:
sudo find / -name "*tkinter*"
/usr /local /lib /python3.9 /tkinter
/tmp /tcloop /python3.9 /usr /local /lib /python3.9/tkinter :(
As per the *tcz.list files in piCore-13.x armv7, python2.7, python3.8 and python3.9 do not contain _tkinter*.so, so I would guess (I may be wrong) that they were not compiled against tk.
Can i compile it somehow ?
-
That sounds like you are talking about x86:
http://tinycorelinux.net/10.x/x86/tcz/tcl8.6.tcz.info
or x86_64:
http://tinycorelinux.net/10.x/x86_64/tcz/tcl8.6.tcz.info
Hi Rich,
yes i am talking about TinyCore x86_64
But how could i take a tkinter program to work on piCore armv7 V13.x :-\
-
Drop the python maintainer a pm to request if they could recompile python against tk.
-
Hi Juanito,
i did install python3.6 from Version /8.x/armv7/
but i am missing now this extension "python3.6-cryptography.tcz" and its dependancy
Could you help with that ?
Thx
-
Are you using python3.6 from the piCore-8.x repo (I see it contains _tkinter.cpython-36m-arm-linux-gnueabihf.so and presumably works with tk) in pyCore-13.x?
You can see how python-cryptography was compiled for CorePure64 here:
http://tinycorelinux.net/11.x/x86_64/tcz/src/python-cryptography/compile_python-cryptography
-
As a test in piCore64, pip installed cffi-1.14.6, pycparser-2.20 and cryptography-3.4.7
-
Are you using python3.6 from the piCore-8.x repo (I see it contains _tkinter.cpython-36m-arm-linux-gnueabihf.so and presumably works with tk) in pyCore-13.x?
You can see how python-cryptography was compiled for CorePure64 here:
http://tinycorelinux.net/11.x/x86_64/tcz/src/python-cryptography/compile_python-cryptography
Hi Juanito,
yes exactly
You can see how python-cryptography was compiled for CorePure64 here:
I also did downloaded the extension "python3.6-cryptography.tcz" from the Repo. of CorePure64 /10.x/x86_64/
and installed it on my PiCore-13.x but now when i run the Program, who shlould import from Cryptography.
I get this error:
Traceback (most recent call last):
File "/opt/Scripts/.NFZ_RDP.py", line 5, in <module>
from cryptography.fernet import Fernet
File "/usr/local/lib/python3.6/site-packages/cryptography/fernet.py", line 17, in <module>
from cryptography.hazmat.primitives import hashes, padding
File "/usr/local/lib/python3.6/site-packages/cryptography/hazmat/primitives/padding.py", line 13, in <module>
from cryptography.hazmat.bindings._padding import lib
ImportError: /usr/local/lib/python3.6/site-packages/cryptography/hazmat/bindings/_padding.abi3.so: wrong ELF class: ELFCLASS64
when i try to use pip to install cryptography i get:
pip is configured with locations that require TLS/SSL, however the ssl module in Python is not available.
Collecting cryptography
Could not fetch URL https://pypi.python.org/simple/cryptography/: There was a problem confirming the ssl certificate: Can't connect to HTTPS URL because the SSL module is not available. - skipping
Could not find a version that satisfies the requirement cryptography (from versions: )
No matching distribution found for cryptography
any Ideas?
-
You cannot use extensions compiled for one architecture (CorePure64) in another architecture (piCore) - this why you get the error "wrong ELF class: ELFCLASS64".
In addition, if you use an extension from an earlier version (8.x) of the same architecture, you run the risk that one of its dependencies has been updated in the most recent version (13.x) and is no longer compatible.
piCore-8.x uses openssl-1.0.2, which is not compatible with piCore-13.x openssl-1.1.1.
-
If you haven't heard from the python3.8 maintainer, one solution is to compile your own python extension against ncurses, openssl and tk and then compile python-cryptography against that.
You could use this:
http://tinycorelinux.net/11.x/x86_64/tcz/src/python3.6/compile_python3.6
..but substitute "-march=armv6zk -mtune=arm1176jzf-s -mfpu=vfp -Os -pipe" for "-flto -fuse-linker-plugin -mtune=generic -Os -pipe"
-
You cannot use extensions compiled for one architecture (CorePure64) in another architecture (piCore) - this why you get the error "wrong ELF class: ELFCLASS64".
In addition, if you use an extension from an earlier version (8.x) of the same architecture, you run the risk that one of its dependencies has been updated in the most recent version (13.x) and is no longer compatible.
piCore-8.x uses openssl-1.0.2, which is not compatible with piCore-13.x openssl-1.1.1.
Hi Juanito,
you are absolutely right!
If you haven't heard from the python3.8 maintainer, one solution is to compile your own python extension against ncurses, openssl and tk and then compile python-cryptography against that.
You could use this:
http://tinycorelinux.net/11.x/x86_64/tcz/src/python3.6/compile_python3.6
..but substitute "-march=armv6zk -mtune=arm1176jzf-s -mfpu=vfp -Os -pipe" for "-flto -fuse-linker-plugin -mtune=generic -Os -pipe"
i am gonna need some help doing that, like how to do it step by step (Cause i am not that pro.) :-\
i understood that i need to install those extensions
tce-load -i compiletc openssl-1.1.1-dev sqlite3-dev tk8.6-dev glib2-dev gdbm-dev bzip2-dev Xorg-7.7-dev liblzma-dev readline-dev
cd Python-3.6.9
edit setup.py
and then go to the directory of Python and edit setup.py
anyway i cant find the file setup.py
Thx
-
You need to uncompressed the source - i.e. “tar xf Python*tar*”
-
Hi Juanito,
and what do i do with this:
curses_includes.append('/usr/local/include/ncursesw')
CPPFLAGS="-I/usr/local/include/ncursesw" CC="gcc -flto -fuse-linker-plugin -mtune=generic -Os -pipe" CXX="g++ -flto -fuse-linker-plugin -mtune=generic -Os -pipe -fno-exceptions -fno-rtti"
-
Edit that line in setup.py
..and then: $ CPPFLAGS="-I/usr/local/include/ncursesw" CC="gcc -march=armv6zk -mtune=arm1176jzf-s -mfpu=vfp -Os -pipe" CXX="g++ -march=armv6zk -mtune=arm1176jzf-s -mfpu=vfp -Os -pipe -fno-exceptions -fno-rtti" ./configure --prefix=/usr/local --localstatedir=/var --enable-shared --with-system-expat --with-system-ffi --with-ensurepip=yes --with-tcltk-includes='-I/usr/local/include' --with-tcltk-libs='-L/usr/local/lib -ltk8.6 -ltcl8.6
-
Hi Juanito,
when i run this:
CPPFLAGS="-I/usr/local/include/ncursesw" CC="gcc -march=armv6zk -mtune=arm1176jzf-s -mfpu=vfp -Os -pipe" CXX="g++ -march=armv6zk -mtune=arm1176jzf-s -mfpu=vfp -Os -
pipe -fno-exceptions -fno-rtti" ./configure --prefix=/usr/local --localstatedir=/var --enable-shared --with-system-expat --with-system-ffi --with-ensurepip=yes --with-tcltk-includes='-I/usr/local/include' --with-tcltk-libs='-L/usr/local/lib -ltk8.6 -ltcl8.6
this what i get one error about tkinter:
In file included from /usr/local/include/tk.h:96,
from /opt/Python-3.6.9/Modules/_tkinter.c:50:
/usr/local/include/X11/Xlib.h:44:10: fatal error: X11/X.h: No such file or directory
44 | #include <X11/X.h>
| ^~~~~~~~~
If you haven't heard from the python3.8 maintainer, one solution is to compile your own python extension against ncurses, openssl and tk and then compile python-cryptography against that.
how do i compile python against ncurses, openssl, tk and python-cryptography ?
-
Did you load the *-dev extensions referenced in the earlier example - i.e. Xorg-dev, tk-dev, openssl-dev, ncurses-dev, etc?
-
Did you load the *-dev extensions referenced in the earlier example - i.e. Xorg-dev, tk-dev, openssl-dev, ncurses-dev, etc?
ops! it seems like i forgot those two liblzma-dev readline-dev
now i have it installed, but i still don't know how to compile it against tk and python-cryptography :-\
is there another way to save the compiled python after rebooting without puting it in /opt/.filetool.lst ? because it will take so long every time i save something
thx
-
The previous error you got about tk looking for Xlib.h means that (after you loaded Xorg-dev) python did compile against tk.
You can make an extension out of the files loaded by “sudo make install” to avoid recompiling each time you reboot.
-
The previous error you got about tk looking for Xlib.h means that (after you loaded Xorg-dev) python did compile against tk.
there is no xorg-dev.tcz in the repo. of piCore v13.x armv7 but xorg-server-dev!
You can make an extension out of the files loaded by “sudo make install” to avoid recompiling each time you reboot.
i already did that but python is not there anymore after reboot, i think there is an missing step :(
-
Sorry, mesa-dev should work in place of xorg-dev.
Does the extension you made contain a symlink from python to python3.6?
-
you can make an extension out of the files loaded by “sudo make install” to avoid recompiling each time you reboot.
i think we misunderstood each other i already did this step "sudo make install"
but i don't know how to make an extension out of the files that were loaded by the command: "sudo make install"
-
See attached file
-
Hi Juanito,
first sorry for being so noob and for asking to much but i have some questions:
touch mymarker
What is mymaker ?
$ sudo tar -T files --numeric-owner -zcvf extension.tar.gz
where do i find all the files were make by "sudo make install" ? or shlouldn't i replace the word files with a path from those files
-
"touch" writes a zero byte file - in this case named "mymarker".
The complicated command after that makes a list of all files created after "mymarker" and puts the list into a file named "files".
"sudo tar blah-blah" makes a tarball named "extension.tar.gz out of all the files listed in "files".
-
I compiled python3.6 in piCore-12.x - it should work in piCore-13.x, so added to the repo.
Now all you need to do is compile python-cryptography and its deps against python3.6...
-
Hi Juanito,
I compiled python3.6 in piCore-12.x - it should work in piCore-13.x, so added to the repo.
Thank you very much!
Now all you need to do is compile python-cryptography and its deps against python3.6...
that ist my goal after all, would you tell me how to do that ?
i tried to install it directly with
pip3.6 install cryptographyBut i am getting an error :-[
-
You need something like this:
* "tce-load -i compiletc python3.6-dev"
* "wget [source tarball]"
* "tar xf [source tarball]"
* "cd [source]"
* "python3.6 setup.py build"
* "mkdir /tmp/pkg"
* "sudo python3.6 setup.py install --root=/tmp/pkg"
Then remove the "__pycache__" subdirectories from /tmp/pkg/usr/local/lib/python3.6/site-packages (they are several layers deep)
* "cd /tmp"
* sudo mksquashfs pkg/ python3.6-[source].tcz
-
But i am getting an error
That comment is only useful for telepaths :P
-
Hi Juanito,
* "python3.6 setup.py build"
=============================DEBUG ASSISTANCE==========================
If you are seeing an error here please try the following to
successfully install cryptography:
Upgrade to the latest pip and try again. This will fix errors for most
users. See: https://pip.pypa.io/en/stable/installing/#upgrading-pip
=============================DEBUG ASSISTANCE==========================
Traceback (most recent call last):
File "setup.py", line 14, in <module>
from setuptools_rust import RustExtension
ModuleNotFoundError: No module named 'setuptools_rust'
i installed rust.tcz but it didn't help
any Ideas ?
-
It looks like you need: https://pypi.org/project/setuptools-rust/
-
I'd suggest that you try an earlier version of cryptography that doesn't use rust, for example:
https://github.com/pyca/cryptography/archive/refs/tags/3.2.1.tar.gz
-
Hi Juanito,
thank you very very much my program works finaly :) :)