Anki Forums

Pyqt5 run/build problem on 32 bit

Hello,
I’m trying to build anki on a 32 bit i686 Lubuntu 18.04 platform. First problem was getting bazel! After a day or so I managed to build the bazel binary and so I downloaded the latest Anki source. Following the instructions I did ./run in src folder and I get an issue with pyqt5 - I’ve seen similar mentions elsewhere but nothing I’ve tried works. Any help appreciated, the console output is as follows:

 `ERROR: /home/shanghai/Documents/Applications/anki-main/qt/aqt/BUILD.bazel:74:11: //qt/aqt:aqt_with_data depends on @pyqt5//:pkg in repository @pyqt5 which failed to fetch. no such package '@pyqt5//': failed: Collecting pyqt5==5.15.2

Using cached PyQt5-5.15.2.tar.gz (3.3 MB)
Installing build dependencies: started
Installing build dependencies: finished with status ‘done’
Getting requirements to build wheel: started
Getting requirements to build wheel: finished with status ‘done’
Preparing wheel metadata: started
Preparing wheel metadata: finished with status ‘error’
(/usr/lib/python3/dist-packages/keyring/util/properties.py:1: DeprecationWarning: Using or importing the ABCs from ‘collections’ instead of from ‘collections.abc’ is deprecated since Python 3.3, and in 3.9 it will stop working
from collections import Callable
ERROR: Command errored out with exit status 1:
command: /home/shanghai/.cache/bazel/_bazel_shanghai/a49ef30009d041cf84dd7a8817790c9f/external/python/python /home/shanghai/.cache/bazel/_bazel_shanghai/a49ef30009d041cf84dd7a8817790c9f/external/com_github_ali5h_rules_pip/third_party/py/pip/_vendor/pep517/_in_process.py prepare_metadata_for_build_wheel /tmp/tmpbluyqcbd
cwd: /tmp/pip-install-4op5mzsl/pyqt5
Complete output (39 lines):
Querying qmake about your Qt installation…
/usr/bin/qmake -query
Traceback (most recent call last):
File “/home/shanghai/.cache/bazel/_bazel_shanghai/a49ef30009d041cf84dd7a8817790c9f/external/com_github_ali5h_rules_pip/third_party/py/pip/_vendor/pep517/_in_process.py”, line 126, 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:

Traceback (most recent call last):
  File "/home/shanghai/.cache/bazel/_bazel_shanghai/a49ef30009d041cf84dd7a8817790c9f/external/com_github_ali5h_rules_pip/third_party/py/pip/_vendor/pep517/_in_process.py", line 280, in <module>
    main()
  File "/home/shanghai/.cache/bazel/_bazel_shanghai/a49ef30009d041cf84dd7a8817790c9f/external/com_github_ali5h_rules_pip/third_party/py/pip/_vendor/pep517/_in_process.py", line 263, in main
    json_out['return_val'] = hook(**hook_input['kwargs'])
  File "/home/shanghai/.cache/bazel/_bazel_shanghai/a49ef30009d041cf84dd7a8817790c9f/external/com_github_ali5h_rules_pip/third_party/py/pip/_vendor/pep517/_in_process.py", line 130, in prepare_metadata_for_build_wheel
    return _get_wheel_metadata_from_wheel(backend, metadata_directory,
  File "/home/shanghai/.cache/bazel/_bazel_shanghai/a49ef30009d041cf84dd7a8817790c9f/external/com_github_ali5h_rules_pip/third_party/py/pip/_vendor/pep517/_in_process.py", line 159, in _get_wheel_metadata_from_wheel
    whl_basename = backend.build_wheel(metadata_directory, config_settings)
  File "/tmp/pip-build-env-x6uey52n/overlay/lib/python3.8/site-packages/sipbuild/api.py", line 51, in build_wheel
    project = AbstractProject.bootstrap('pep517')
  File "/tmp/pip-build-env-x6uey52n/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-x6uey52n/overlay/lib/python3.8/site-packages/sipbuild/project.py", line 481, 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-x6uey52n/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-x6uey52n/overlay/lib/python3.8/site-packages/sipbuild/project.py", line 227, in apply_user_defaults
    self.builder.apply_user_defaults(tool)
  File "/tmp/pip-build-env-x6uey52n/overlay/lib/python3.8/site-packages/pyqtbuild/builder.py", line 75, in apply_user_defaults
    self._get_qt_configuration()
  File "/tmp/pip-build-env-x6uey52n/overlay/lib/python3.8/site-packages/pyqtbuild/builder.py", line 484, in _get_qt_configuration
    for line in project.read_command_pipe([self.qmake, '-query']):
  File "/tmp/pip-build-env-x6uey52n/overlay/lib/python3.8/site-packages/sipbuild/project.py", line 444, in read_command_pipe
    raise UserException(
sipbuild.exceptions.UserException
/usr/lib/python3.8/tempfile.py:955: ResourceWarning: Implicitly cleaning up <TemporaryDirectory '/tmp/tmp2kpbzzfs'>
  _warnings.warn(warn_message, ResourceWarning)
----------------------------------------

ERROR: Command errored out with exit status 1: /home/shanghai/.cache/bazel/_bazel_shanghai/a49ef30009d041cf84dd7a8817790c9f/external/python/python /home/shanghai/.cache/bazel/_bazel_shanghai/a49ef30009d041cf84dd7a8817790c9f/external/com_github_ali5h_rules_pip/third_party/py/pip/_vendor/pep517/_in_process.py prepare_metadata_for_build_wheel /tmp/tmpbluyqcbd Check the logs for full command output.
Traceback (most recent call last):
File “/home/shanghai/Documents/Applications/anki-main/pip/pyqt5/install_pyqt5.py”, line 199, in
main()
File “/home/shanghai/Documents/Applications/anki-main/pip/pyqt5/install_pyqt5.py”, line 155, in main
_pkg = install_package(with_version, folder, [])
File “/home/shanghai/Documents/Applications/anki-main/pip/pyqt5/install_pyqt5.py”, line 58, in install_package
dist_info = glob.glob(os.path.join(directory, “*.dist-info”))[0]
IndexError: list index out of range
)
ERROR: Analysis of target ‘//qt:runanki’ failed; build aborted: Analysis failed
INFO: Elapsed time: 12.496s
INFO: 0 processes.
FAILED: Build did NOT complete successfully (0 packages loaded, 0 targets conf
FAILED: Build did NOT complete successfully (0 packages loaded, 0 targets conf
igured)
Fetching @pypi__38__orjson_3_4_7; fetching 12s
`

1 Like

Thanks for the response - that’s a shame and although I can see it’s inevitable that once the tools migrate the software moves too. Although, in principle I don’t see why a flashcard app needs to be 64 bit, I guess it has to be if it’s built on all these 64 bit technologies… I can’t find a 32 bit binary for 2.1.35 - in the git assets for that release there is amd-64 and windows-alternate but no 32 bit linux asset - is there one available somewhere? Many thanks.

The alternate build for Linux was dropped in 2.1.17. But I guess you can still build 2.1.35 from source.

1 Like

Many thanks, I’ll take a look; though it’s tempting to see if I can build the entire toolchain in 32 bit… :slight_smile: thanks for you help.

You will have more and more issues with open source projects that do not support 32-bit, recommend moving to 64 bit. Better performance, too.