WelcomeWelcome | FAQFAQ | DownloadsDownloads | WikiWiki

Author Topic: python  (Read 11486 times)

Offline Rich

  • Administrator
  • Hero Member
  • *****
  • Posts: 11221
Re: python
« Reply #15 on: July 18, 2021, 12:49:53 PM »

Offline Rabie

  • Sr. Member
  • ****
  • Posts: 272
Re: python
« Reply #16 on: July 19, 2021, 06:22:55 AM »
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


Offline Juanito

  • Administrator
  • Hero Member
  • *****
  • Posts: 14546
Re: python
« Reply #17 on: July 19, 2021, 08:47:02 AM »
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?
« Last Edit: July 19, 2021, 09:29:59 AM by Juanito »

Offline Juanito

  • Administrator
  • Hero Member
  • *****
  • Posts: 14546
Re: python
« Reply #18 on: July 20, 2021, 08:04:49 AM »
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.

Offline Rich

  • Administrator
  • Hero Member
  • *****
  • Posts: 11221
Re: python
« Reply #19 on: July 20, 2021, 11:36:22 AM »
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

Offline Rabie

  • Sr. Member
  • ****
  • Posts: 272
Re: python
« Reply #20 on: July 23, 2021, 03:28:41 AM »
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 ?
« Last Edit: July 23, 2021, 03:36:52 AM by Rabie »

Offline Rabie

  • Sr. Member
  • ****
  • Posts: 272
Re: python
« Reply #21 on: July 23, 2021, 04:16:47 AM »
Quote
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  :-\


Offline Juanito

  • Administrator
  • Hero Member
  • *****
  • Posts: 14546
Re: python
« Reply #22 on: July 23, 2021, 04:57:46 AM »
Drop the python maintainer a pm to request if they could recompile python against tk.

Offline Rabie

  • Sr. Member
  • ****
  • Posts: 272
Re: python
« Reply #23 on: July 26, 2021, 05:15:00 AM »
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

Offline Juanito

  • Administrator
  • Hero Member
  • *****
  • Posts: 14546
Re: python
« Reply #24 on: July 26, 2021, 05:33:03 AM »
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

Offline Juanito

  • Administrator
  • Hero Member
  • *****
  • Posts: 14546
Re: python
« Reply #25 on: July 26, 2021, 06:16:44 AM »
As a test in piCore64, pip installed cffi-1.14.6,  pycparser-2.20 and cryptography-3.4.7

Offline Rabie

  • Sr. Member
  • ****
  • Posts: 272
Re: python
« Reply #26 on: July 26, 2021, 06:52:48 AM »
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

Quote
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:

Code: [Select]
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:

Code: [Select]
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?

Offline Juanito

  • Administrator
  • Hero Member
  • *****
  • Posts: 14546
Re: python
« Reply #27 on: July 26, 2021, 07:07:54 AM »
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.

Offline Juanito

  • Administrator
  • Hero Member
  • *****
  • Posts: 14546
Re: python
« Reply #28 on: July 26, 2021, 07:14:51 AM »
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"
« Last Edit: July 26, 2021, 07:16:25 AM by Juanito »

Offline Rabie

  • Sr. Member
  • ****
  • Posts: 272
Re: python
« Reply #29 on: July 27, 2021, 09:54:11 AM »
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!


Quote
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
Quote
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

Quote
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