Score:-2

Why I get this error installing python venv software?

it flag

I'm quite new to linux and python and I'm trying to install a python software (openmotor) in a python virtual enviroment as the author recommends to do it but I'm getting this error message when trying to install required packages.


$ pip install -r requirements.txt

Collecting appdirs
  Using cached appdirs-1.4.4-py2.py3-none-any.whl (9.6 kB)
Collecting cycler
  Using cached cycler-0.11.0-py3-none-any.whl (6.4 kB)
Collecting decorator
  Using cached decorator-5.1.1-py3-none-any.whl (9.1 kB)
Processing /home/daniel/.cache/pip/wheels/56/ea/58/ead137b087d9e326852a851351d1debf4ada529b6ac0ec4e8c/docopt-0.6.2-py2.py3-none-any.whl
Collecting ezdxf
  Using cached ezdxf-1.0.2-cp38-cp38-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_12_x86_64.manylinux2010_x86_64.whl (3.2 MB)
Collecting imageio
  Using cached imageio-2.26.1-py3-none-any.whl (3.4 MB)
Collecting matplotlib
  Using cached matplotlib-3.7.1-cp38-cp38-manylinux_2_12_x86_64.manylinux2010_x86_64.whl (9.2 MB)
Collecting networkx
  Using cached networkx-3.0-py3-none-any.whl (2.0 MB)
Collecting numpy
  Using cached numpy-1.24.2-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (17.3 MB)
Collecting Pillow
  Using cached Pillow-9.4.0-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (3.3 MB)
Collecting pyparsing
  Using cached pyparsing-3.0.9-py3-none-any.whl (98 kB)
Collecting pyqt-distutils
  Using cached pyqt_distutils-0.7.3-py2.py3-none-any.whl (7.8 kB)
Collecting PyQt5
  Using cached PyQt5-5.15.9.tar.gz (3.2 MB)
  Installing build dependencies ... done
  Getting requirements to build wheel ... done
    Preparing wheel metadata ... error
    ERROR: Command errored out with exit status 1:
     command: /home/daniel/openMotor/.venv/bin/python3 /tmp/tmpnkx3pbua prepare_metadata_for_build_wheel /tmp/tmpbc53w75u
         cwd: /tmp/pip-install-n21cyx0e/PyQt5
    Complete output (31 lines):
    Traceback (most recent call last):
      File "/tmp/tmpnkx3pbua", 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 "/tmp/tmpnkx3pbua", line 280, in <module>
        main()
      File "/tmp/tmpnkx3pbua", line 263, in main
        json_out['return_val'] = hook(**hook_input['kwargs'])
      File "/tmp/tmpnkx3pbua", line 130, in prepare_metadata_for_build_wheel
        return _get_wheel_metadata_from_wheel(backend, metadata_directory,
      File "/tmp/tmpnkx3pbua", line 159, in _get_wheel_metadata_from_wheel
        whl_basename = backend.build_wheel(metadata_directory, config_settings)
      File "/tmp/pip-build-env-zzcpxk69/overlay/lib/python3.8/site-packages/sipbuild/api.py", line 46, in build_wheel
        project = AbstractProject.bootstrap('wheel',
      File "/tmp/pip-build-env-zzcpxk69/overlay/lib/python3.8/site-packages/sipbuild/abstract_project.py", line 87, in bootstrap
        project.setup(pyproject, tool, tool_description)
      File "/tmp/pip-build-env-zzcpxk69/overlay/lib/python3.8/site-packages/sipbuild/project.py", line 585, in setup
        self.apply_user_defaults(tool)
      File "/tmp/pip-install-n21cyx0e/PyQt5/project.py", line 68, in apply_user_defaults
        super().apply_user_defaults(tool)
      File "/tmp/pip-build-env-zzcpxk69/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-zzcpxk69/overlay/lib/python3.8/site-packages/sipbuild/project.py", line 236, in apply_user_defaults
        self.builder.apply_user_defaults(tool)
      File "/tmp/pip-build-env-zzcpxk69/overlay/lib/python3.8/site-packages/pyqtbuild/builder.py", line 69, in apply_user_defaults
        raise PyProjectOptionException('qmake',
    sipbuild.pyproject.PyProjectOptionException
    ----------------------------------------
ERROR: Command errored out with exit status 1: /home/daniel/openMotor/.venv/bin/python3 /tmp/tmpnkx3pbua prepare_metadata_for_build_wheel /tmp/tmpbc53w75u Check the logs for full command output.


The software is being developed in Python 3.10 but my venv is running 3.8 I guess as it is my main python instalation could it be the cause? if not, any tips in how to solve it?

Thanks

aq flag
missing libraries perhaps? I installed it with apt: `sudo apt install python3-pyqt5` but you are using a virtual env. Maybe that will install the libraries you need to build it as well.
guiverc avatar
cn flag
What OS/release are you using?
Score:0
in flag

The issue is that the program qmake isn't on your PATH (hat tip: https://stackoverflow.com/a/72046110). If it isn't on your system, you may be able to install it via:

sudo apt-get install qt5-qmake

The virtual environment is a good idea, as it isolates your python dependencies for this project. But pyqt has dependencies outside of the Python ecosystem.

daniel arenas avatar
it flag
Thank, it helped to remove the error, but now it gets stuck in ` Preparing wheel metadata ... - ` and doesn't show anything else. Would preciate some advice with that.
Chris May avatar
in flag
My first thought would be to ensure `wheel` is installed (via `pip install wheel`). But I see comments about having to confirm the license for PyQT [here](https://stackoverflow.com/questions/73714829/pip-install-pyqt5-it-cannot-go-on) and [here](https://stackoverflow.com/a/73818706). It looks like the syntax would be `pip install pyqt5 --config-settings --confirm-license=`.
daniel arenas avatar
it flag
Thanks so much for your help, but it didn't work for me. However I solved it uninstalling the pip version provided by the developer of the software I was trying to install an installing a more recent verision in the same virtual enviromen, the procedure is explained here:https://stackoverflow.com/questions/69333000/pip-hangs-on-installing-packages if it could help someone.
I sit in a Tesla and translated this thread with Ai:

mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.