jopohl / urh

Universal Radio Hacker: Investigate Wireless Protocols Like A Boss
GNU General Public License v3.0
10.99k stars 874 forks source link

You need Cython to build URH's extensions! #1064

Closed tomcass240 closed 1 year ago

tomcass240 commented 1 year ago

Describe the bug Trying to install urh using pipx install urh. I get the message

Fatal error from pip prevented installation. Full pip output in file: /home/z/.local/pipx/logs/cmd_2023-09-06_22.54.24_pip_errors.log

pip seemed to fail to build package: urh

Some possibly relevant errors from pip install: error: subprocess-exited-with-error error: metadata-generation-failed

cat /root/.local/pipx/logs/cmd_2023-09-06_22.51.35_pip_errors.log PIP STDOUT

Collecting urh Using cached urh-2.9.4.tar.gz (3.0 MB) Preparing metadata (setup.py): started Preparing metadata (setup.py): finished with status 'error'

PIP STDERR

error: subprocess-exited-with-error

× python setup.py egg_info did not run successfully. │ exit code: 1 ╰─> [2 lines of output] You need Cython to build URH's extensions! You can get it e.g. with python3 -m pip install cython. [end of output]

note: This error originates from a subprocess, and is likely not a problem with pip. error: metadata-generation-failed

× Encountered error while generating package metadata. ╰─> See above for output.

note: This is an issue with the package mentioned above, not pip. hint: See above for details.

How to reproduce Try to install urh with pipx on Debian. Python3 and Cython3 both installed using package manager.

Expected behavior Installed correctly as Cython is installed.

If I try typing sudo pip3 install urh

I get this error message:

error: externally-managed-environment

× This environment is externally managed ╰─> To install Python packages system-wide, try apt install python3-xyz, where xyz is the package you are trying to install.

If you wish to install a non-Debian-packaged Python package,
create a virtual environment using python3 -m venv path/to/venv.
Then use path/to/venv/bin/python and path/to/venv/bin/pip. Make
sure you have python3-full installed.

If you wish to install a non-Debian packaged Python application,
it may be easiest to use pipx install xyz, which will manage a
virtual environment for you. Make sure you have pipx installed.

See /usr/share/doc/python3.11/README.venv for more information.

I found advice on here suggesting using venv and installing it to a python virtual environment. This worked but it didn't have access to any of my existing libraries so there was no device support with it, making it useless.

I've just uninstalled it for now. Are there any better programs out there than URH?

jopohl commented 1 year ago

You run Python 3.11 for which there are no prebuilt wheels on PyPi.

You have couple of options:

  1. Use snap
  2. Use the URH docker image
  3. install the SDR dev packages you want to use e.g. apt install libhackrf-dev and, afterwards, install URH again with pip
jopohl commented 1 year ago

Just released v2.9.5 which includes Python wheels for 3.10, 3.11 and 3.12. So installation with pip / pipx should be smooth now for recent Python versions.

Crsarmv7l commented 2 weeks ago

I am having this exact issue with python 3.12, Cython was installed via pip and installed failed citing no cython. I installed cython via apt, same result