WelcomeWelcome | FAQFAQ | DownloadsDownloads | WikiWiki

Author Topic: pyqt5 picore 13.0.3 rpi 4  (Read 4700 times)

Offline ketank

  • Newbie
  • *
  • Posts: 40
  • learning ...
pyqt5 picore 13.0.3 rpi 4
« on: November 13, 2021, 08:25:17 AM »
Hi

I am struggling to install pyqt5.
All the dependencies get installed successfully but then it fails with
pip install -v --no-cache-dir --prefer-binary pyqt5

fails with - AttributeError: module 'sipbuild.api' has no attribute 'prepare_metadata_for_build_wheel'

environment - RPi 4 with 8 GB RAM, python - 3.8.7, pip 21.3.1

complete error message

Code: [Select]
Using pip 21.3.1 from /usr/local/lib/python3.8/site-packages/pip (python 3.8)
Defaulting to user installation because normal site-packages is not writeable
Collecting pyqt5
  Downloading PyQt5-5.15.6.tar.gz (3.2 MB)
     |¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦| 3.2 MB 1.8 MB/s
  Running command /usr/local/bin/python3 /tmp/pip-standalone-pip-v8_euyno/__env_pip__.zip/pip install --ignore-installed --no-user --prefix /tmp/pip-build-env-9e__4znn/overlay --no-warn-script-location --no-binary :none: --only-binary :none: -i https://pypi.org/simple --prefer-binary -- 'sip >=6.4, <7' 'PyQt-builder >=1.9, <2'
  Collecting sip<7,>=6.4
    Using cached sip-6.4.0-cp36-abi3-linux_armv7l.whl
  Collecting PyQt-builder<2,>=1.9
    Using cached PyQt_builder-1.12.2-py3-none-any.whl (5.6 MB)
  Collecting packaging
    Using cached packaging-21.2-py3-none-any.whl (40 kB)
  Collecting setuptools
    Using cached setuptools-58.5.3-py3-none-any.whl (946 kB)
  Collecting toml
    Using cached toml-0.10.2-py2.py3-none-any.whl (16 kB)
  Collecting pyparsing<3,>=2.0.2
    Using cached pyparsing-2.4.7-py2.py3-none-any.whl (67 kB)
  Installing collected packages: pyparsing, toml, setuptools, packaging, sip, PyQt-builder
  Successfully installed PyQt-builder-1.12.2 packaging-21.2 pyparsing-2.4.7 setuptools-58.5.3 sip-6.4.0 toml-0.10.2
  Installing build dependencies ... done
  Running command /usr/local/bin/python3 /usr/local/lib/python3.8/site-packages/pip/_vendor/pep517/in_process/_in_process.py get_requires_for_build_wheel /tmp/tmpa50av598
  Getting requirements to build wheel ... done
  Running command /usr/local/bin/python3 /usr/local/lib/python3.8/site-packages/pip/_vendor/pep517/in_process/_in_process.py prepare_metadata_for_build_wheel /tmp/tmp_16ohk2q
  Traceback (most recent call last):
    File "/usr/local/lib/python3.8/site-packages/pip/_vendor/pep517/in_process/_in_process.py", line 156, in prepare_metadata_for_build_wheel
      hook = backend.prepare_metadata_for_build_wheel
  AttributeError: module 'sipbuild.api' has no attribute 'prepare_metadata_for_build_wheel'

  During handling of the above exception, another exception occurred:

Code: [Select]
  Traceback (most recent call last):
    File "/usr/local/lib/python3.8/site-packages/pip/_vendor/pep517/in_process/_in_process.py", line 363, in <module>
      main()
    File "/usr/local/lib/python3.8/site-packages/pip/_vendor/pep517/in_process/_in_process.py", line 345, in main
      json_out['return_val'] = hook(**hook_input['kwargs'])
    File "/usr/local/lib/python3.8/site-packages/pip/_vendor/pep517/in_process/_in_process.py", line 160, in prepare_metadata_for_build_wheel
      whl_basename = backend.build_wheel(metadata_directory, config_settings)
    File "/tmp/pip-build-env-9e__4znn/overlay/lib/python3.8/site-packages/sipbuild/api.py", line 51, in build_wheel
      project = AbstractProject.bootstrap('pep517')
    File "/tmp/pip-build-env-9e__4znn/overlay/lib/python3.8/site-packages/sipbuild/abstract_project.py", line 83, in bootstrap
      project.setup(pyproject, tool, tool_description)
    File "/tmp/pip-build-env-9e__4znn/overlay/lib/python3.8/site-packages/sipbuild/project.py", line 587, in setup
      self.apply_user_defaults(tool)
    File "project.py", line 63, in apply_user_defaults
      super().apply_user_defaults(tool)
    File "/tmp/pip-build-env-9e__4znn/overlay/lib/python3.8/site-packages/pyqtbuild/project.py", line 70, in apply_user_defaults
      super().apply_user_defaults(tool)
    File "/tmp/pip-build-env-9e__4znn/overlay/lib/python3.8/site-packages/sipbuild/project.py", line 234, in apply_user_defaults
      self.builder.apply_user_defaults(tool)
    File "/tmp/pip-build-env-9e__4znn/overlay/lib/python3.8/site-packages/pyqtbuild/builder.py", line 67, in apply_user_defaults
      raise PyProjectOptionException('qmake',
  sipbuild.pyproject.PyProjectOptionException
  Preparing metadata (pyproject.toml) ... error

    [EDIT]: Added code tags.  Rich
« Last Edit: November 15, 2021, 06:29:33 AM by Rich »

Offline Juanito

  • Administrator
  • Hero Member
  • *****
  • Posts: 14516
Re: pyqt5 picore 13.0.3 rpi 4
« Reply #1 on: November 13, 2021, 09:35:58 AM »
If pyqt5 involves installing qt5, which is huge, using pip is going to use a lot of ram.

You'd probably be better off compiling qt5 and pyqt5 and making extensions out of them.

Offline ketank

  • Newbie
  • *
  • Posts: 40
  • learning ...
Re: pyqt5 picore 13.0.3 rpi 4
« Reply #2 on: November 13, 2021, 10:01:05 AM »
Thank you Juanito

compiling qt5 is something I was avoiding but seems no option ...

let me try and that post an update if I could do that

Offline ketank

  • Newbie
  • *
  • Posts: 40
  • learning ...
Re: pyqt5 picore 13.0.3 rpi 4
« Reply #3 on: November 14, 2021, 12:35:47 AM »
Hi

I am trying to compile qt5 following the instructions at - http://tinycorelinux.net/11.x/x86_64/tcz/src/qt-5.x/

The problem is step to where I have to extract the qt5 tar. It end with
tar: can't open 'qt-everywhere-src-5.14.0/qtwebengine/src/3rdparty/chromium/cc/raster/raster_buffer.h': No space left on device

I am using a 32 G card and 8 GB RAM.
I feel it is limited by the RAM...

PLEASE HELP!!!!

Offline Juanito

  • Administrator
  • Hero Member
  • *****
  • Posts: 14516
Re: pyqt5 picore 13.0.3 rpi 4
« Reply #4 on: November 14, 2021, 12:43:20 AM »
You need to compile on permanent storage - I use an external usb hd, but you can also use a usb stick.

It is surprising you can't extract the qt5 tarball in 4gb ram (limited by 32-bit piCore) - what else do you have in ram?

Offline ketank

  • Newbie
  • *
  • Posts: 40
  • learning ...
Re: pyqt5 picore 13.0.3 rpi 4
« Reply #5 on: November 14, 2021, 01:18:48 AM »
I will try extracting to a USB drive.

Its a fresh installation and have just installed the requirements based on compile_qt-5.x. nothing else.

RMA is using 738 MB (see attached)

Code: [Select]
/etc/os-release
AME=piCore
VERSION="13.0.3"
ID=piCore
VERSION_ID=13.0.3
PRETTY_NAME="piCore Linux 13.0.3"
ANSI_COLOR="0;34"
CPE_NAME="cpe:/o:picore:picore_linux:13.0.3"
HOME_URL="http://tinycorelinux.net/"
SUPPORT_URL="http://forum.tinycorelinux.net/"
BUG_REPORT_URL="http://forum.tinycorelinux.net/"


Code: [Select]
tc@box:/etc$ uname -a
Linux box 5.10.16-piCore-v7l #1 SMP Tue Feb 16 16:38:31 UTC 2021 armv7l GNU/Linux

    [EDIT]: Added code tags.  Rich
« Last Edit: November 15, 2021, 06:30:43 AM by Rich »

Offline Rich

  • Administrator
  • Hero Member
  • *****
  • Posts: 11178
Re: pyqt5 picore 13.0.3 rpi 4
« Reply #6 on: November 14, 2021, 07:37:21 AM »
Hi Juanito
... It is surprising you can't extract the qt5 tarball in 4gb ram ...
Not really that surprising. If you look here:
http://tinycorelinux.net/11.x/x86_64/tcz/src/qt-5.x/
The listing shows the compressed tarball is over 500Mb in size:
Code: [Select]
qt-everywhere-src-5.14.0.tar.xz                    11-Dec-2019 12:00           547854788Since the contents are primarily text, I imagine it compresses very nicely. At 8 to 1 you are over 4Gb plus whatever
workspace is required to decompress plus the 700Mb shown being used in his screenshot.

The screenshot also shows 2Gb of swap. Is that on permanent storage or also in RAM?

Out of curiosity I placed a few source files into a directory and made a compressed tarball out of them:
Code: [Select]
tc@E310:~/compress$ ls -l
total 208
-rw-r--r-- 1 tc staff 34342 Nov 14 10:24 All.tar.xz
-rw-r--r-- 1 tc staff 20023 Nov 14 09:57 AutoCursor.c
-rw-r--r-- 1 tc staff  6329 Nov 14 09:57 HideMouse.c
-rw-r--r-- 1 tc staff 62903 Nov 14 09:57 ImageEdge.c
-rw-r--r-- 1 tc staff 16630 Nov 14 09:57 PicFormat.c
-rw-r--r-- 1 tc staff 17968 Nov 14 09:57 Resizer.c
-rw-r--r-- 1 tc staff 20412 Nov 14 09:57 TapDrill.c
-rw-r--r-- 1 tc staff   263 Nov 14 09:57 TapDrill.h
-rw-r--r-- 1 tc staff 15177 Nov 14 09:58 TapDrillSizes.h
tc@E310:~/compress$ du -bc *.c *.h | tail -n1
159705  total
tc@E310:~/compress$ calc 159705/34342
4.65043
tc@E310:~/compress$
Even with this small sample size I got a 4.65 to 1 compression ratio.

Offline ketank

  • Newbie
  • *
  • Posts: 40
  • learning ...
Re: pyqt5 picore 13.0.3 rpi 4
« Reply #7 on: November 14, 2021, 09:35:06 AM »
Hi Rich,

It is a separate SWAP file.

Offline ketank

  • Newbie
  • *
  • Posts: 40
  • learning ...
Re: pyqt5 picore 13.0.3 rpi 4
« Reply #8 on: November 14, 2021, 10:09:02 PM »
Current status -
Could not build qt5 based on http://tinycorelinux.net/11.x/x86_64/tcz/src/qt-5.x/
If is failing to create the libraries.

Working to build the latest version 5.12 from source. Will update the progress.

Question - I have to build some other components for the same.
I am building the tcz packages say for cmake right now (the one available in the Pi Core release is older one).

Who and How should I send these packages so they can be used by others too?

Offline Rich

  • Administrator
  • Hero Member
  • *****
  • Posts: 11178
Re: pyqt5 picore 13.0.3 rpi 4
« Reply #9 on: November 14, 2021, 10:15:01 PM »
Hi ketank
If you are considering submitting an extension, Instructions can be found here:
https://web.archive.org/web/20200208152109/http://wiki.tinycorelinux.net/wiki:creating_extensions#submitting

Use the  tcesubmit  email address, not the  picoresubmit  address.

Offline ketank

  • Newbie
  • *
  • Posts: 40
  • learning ...
Re: pyqt5 picore 13.0.3 rpi 4
« Reply #10 on: November 14, 2021, 10:26:15 PM »
Thank you Rich

Offline Juanito

  • Administrator
  • Hero Member
  • *****
  • Posts: 14516
Re: pyqt5 picore 13.0.3 rpi 4
« Reply #11 on: November 14, 2021, 11:48:23 PM »
If is failing to create the libraries.

What error did you get?

Offline ketank

  • Newbie
  • *
  • Posts: 40
  • learning ...
Re: pyqt5 picore 13.0.3 rpi 4
« Reply #12 on: November 15, 2021, 03:58:45 AM »
It was an issue with old version of cmake.
built and installed cmake.

now the problem is with perl.
I have installed perl5.tcz but perl command not found. It is a requirement for qt5

I have no idea about perl so ... reading around...

any help will be appreciated.

Offline Juanito

  • Administrator
  • Hero Member
  • *****
  • Posts: 14516
Re: pyqt5 picore 13.0.3 rpi 4
« Reply #13 on: November 15, 2021, 04:00:52 AM »
qt5 is probably looking for /usr/bin/perl - you can make a symlink to /usr/local/bin/perl

Offline ketank

  • Newbie
  • *
  • Posts: 40
  • learning ...
Re: pyqt5 picore 13.0.3 rpi 4
« Reply #14 on: November 15, 2021, 04:19:58 AM »
perl is not even available in /usr/local/bin/ also