WelcomeWelcome | FAQFAQ | DownloadsDownloads | WikiWiki

Author Topic: python  (Read 14120 times)

Offline Juanito

  • Administrator
  • Hero Member
  • *****
  • Posts: 14817
Re: python
« Reply #30 on: July 28, 2021, 10:15:20 AM »
You need to uncompressed the source - i.e. “tar xf Python*tar*”

Offline Rabie

  • Sr. Member
  • ****
  • Posts: 272
Re: python
« Reply #31 on: July 28, 2021, 10:40:35 AM »
Hi Juanito,

and what do i do with this:

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

Offline Juanito

  • Administrator
  • Hero Member
  • *****
  • Posts: 14817
Re: python
« Reply #32 on: August 01, 2021, 11:01:16 AM »
Edit that line in setup.py

..and then:
Code: [Select]
$ 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

Offline Rabie

  • Sr. Member
  • ****
  • Posts: 272
Re: python
« Reply #33 on: August 02, 2021, 11:48:52 AM »
Hi Juanito,

when i run this:
Code: [Select]
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:

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



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.
how do i compile python against ncurses, openssl, tk and python-cryptography ?

Offline Juanito

  • Administrator
  • Hero Member
  • *****
  • Posts: 14817
Re: python
« Reply #34 on: August 02, 2021, 12:20:54 PM »
Did you load the *-dev extensions referenced in the earlier example - i.e. Xorg-dev, tk-dev, openssl-dev, ncurses-dev, etc?

Offline Rabie

  • Sr. Member
  • ****
  • Posts: 272
Re: python
« Reply #35 on: August 02, 2021, 12:59:19 PM »
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

Offline Juanito

  • Administrator
  • Hero Member
  • *****
  • Posts: 14817
Re: python
« Reply #36 on: August 02, 2021, 01:13:29 PM »
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.

Offline Rabie

  • Sr. Member
  • ****
  • Posts: 272
Re: python
« Reply #37 on: August 02, 2021, 01:54:59 PM »
Quote
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!

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

Offline Juanito

  • Administrator
  • Hero Member
  • *****
  • Posts: 14817
Re: python
« Reply #38 on: August 02, 2021, 02:19:27 PM »
Sorry, mesa-dev should work in place of xorg-dev.

Does the extension you made contain a symlink from python to python3.6?

Offline Rabie

  • Sr. Member
  • ****
  • Posts: 272
Re: python
« Reply #39 on: August 02, 2021, 03:47:04 PM »
Quote
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"

Offline Juanito

  • Administrator
  • Hero Member
  • *****
  • Posts: 14817
Re: python
« Reply #40 on: August 03, 2021, 04:05:09 AM »
See attached file

Offline Rabie

  • Sr. Member
  • ****
  • Posts: 272
Re: python
« Reply #41 on: August 03, 2021, 05:20:46 AM »
Hi Juanito,

first sorry for being so noob and for asking to much but i have some questions:

Quote
Code: [Select]
touch mymarker
What is mymaker ?

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


Offline Juanito

  • Administrator
  • Hero Member
  • *****
  • Posts: 14817
Re: python
« Reply #42 on: August 03, 2021, 06:15:42 AM »
"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".

Offline Juanito

  • Administrator
  • Hero Member
  • *****
  • Posts: 14817
Re: python
« Reply #43 on: August 03, 2021, 06:24:11 AM »
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...

Offline Rabie

  • Sr. Member
  • ****
  • Posts: 272
Re: python
« Reply #44 on: August 03, 2021, 07:14:50 AM »
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!

Quote
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
Code: [Select]
pip3.6 install cryptographyBut i am getting an error  :-[