-
Notifications
You must be signed in to change notification settings - Fork 881
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Crash when using Spectrum Analyzer with GR backend #587
Comments
The python2 stuff is required for the GNU radio backend, which is optional. So what is the exact problem? Especially, please specify this line:
|
Our user reported the following:
The problematic seems code where a system-installed urh with python3 by default is trying to run a python2 |
Steps To Reproduce Edit->Options->Device
File > Spectrum Analyzer > Start
|
The specific "silly thing" I was referencing was this: [DEBUG::AbstractBaseThread.py::initialize_process] /usr/bin/python2 /usr/lib64/python3.6/site-packages/urh/dev/gr/scripts/usrp_recv.py --samplerate 1000000.0 --freq 433920000.0 --gain 50 --bandwidth 1000000.0 --port 1337 calling something installed in the python 3 path but using python2. Perhaps the issue is on our side and we should be installing urh as python2? |
No, urh does not support python 2 officially. See setup.py : |
Now I see! Here is what is going on:
The most easy way to deal with this would be to enter a python 3 interpreter in the options: |
@jopohl we follow each package requirements. In particular, urh was installed as python3 module only and gnuradio as python2 (which seems irrelevant here). I think you need to change that menu to:
as a default option |
@blshkv This would break other distributions such as Arch and Ubuntu which I just checked. Python 3 support will be added in GR 3.8 according to here, while the latest official release for GR is 3.7.13.4. So I won't change the default option here, because it is furthermore documented, that the python 2 support for GR will be kept in later releases. Just to be sure how you installed GR which of these lines does work:
or
|
|
In that case, you also installed GNU Radio as a python 2 module, so how is it supposed to work overall like requested in this issue? Especially this "silly" line
can't work any other way, because GNU Radio is installed as a Python 2 lib. |
that exactly the problem. So we either have to wait for GR 3.8 or make URH support python2 (together with python3 of course). |
How is this a problem? You call a python 2 script with a python 2 interpreter. The GR backend works on many distributions including Arch and Ubuntu in the way it is now. I don't know what is the exact problem on Gentoo but it has nothing to do with Python 2/3. Furthermore, what is the exact reason to use the GR backend in the user's case? Every device (except for FUN Cube dongle) has native support, so there is no need to use the GR backend, because the native one is faster anyway. This is also the reason why the native backend is marked as recommended in the GUI. |
it sounds like my assessment of the issue was incorrect, but there is an issue here for sure. see details in #587 (comment) |
Oh yeah sure, I was a bit mislead by the python 2/3 topic. Fix is on the way, PR is open, and will be merged in master soon. |
Just merged the fix in master. Can you test it on your end? If everything works I will create a new release. |
New release with included fix is out. I am closing here. |
my user confirmed it's working, thanks! |
Expected Behavior
I expect this to work
Actual Behavior
wild errors when urh does silly things. Ideally, on a python3 installation I shouldn't see things like /usr/bin/env python2
Steps To Reproduce
zero@theprophet urh % grep python2 $(qlist urh) (git)-[master]
/usr/lib64/python3.6/site-packages/urh/controller/dialogs/OptionsDialog.py: if self.backend_handler.python2_exe:
/usr/lib64/python3.6/site-packages/urh/controller/dialogs/OptionsDialog.py: self.ui.lineEditPython2Interpreter.setText(self.backend_handler.python2_exe)
/usr/lib64/python3.6/site-packages/urh/controller/dialogs/OptionsDialog.py: self.ui.lineEditPython2Interpreter.editingFinished.connect(self.on_python2_exe_path_edited)
/usr/lib64/python3.6/site-packages/urh/controller/dialogs/OptionsDialog.py: self.ui.btnChoosePython2Interpreter.clicked.connect(self.on_btn_choose_python2_interpreter_clicked)
/usr/lib64/python3.6/site-packages/urh/controller/dialogs/OptionsDialog.py: self.ui.radioButtonPython2Interpreter.clicked.connect(self.on_radio_button_python2_interpreter_clicked)
/usr/lib64/python3.6/site-packages/urh/controller/dialogs/OptionsDialog.py: self.ui.lineEditPython2Interpreter.setText(self.backend_handler.python2_exe)
/usr/lib64/python3.6/site-packages/urh/controller/dialogs/OptionsDialog.py: self.tr("Gnuradio is not installed or incompatible with python2 interpreter."))
/usr/lib64/python3.6/site-packages/urh/controller/dialogs/OptionsDialog.py: self.backend_handler.python2_exe = self.ui.lineEditPython2Interpreter.text()
/usr/lib64/python3.6/site-packages/urh/controller/dialogs/OptionsDialog.py: def on_python2_exe_path_edited(self):
/usr/lib64/python3.6/site-packages/urh/controller/dialogs/OptionsDialog.py: def on_btn_choose_python2_interpreter_clicked(self):
/usr/lib64/python3.6/site-packages/urh/controller/dialogs/OptionsDialog.py: filename, _ = QFileDialog.getOpenFileName(self, self.tr("Choose python2 interpreter"), filter=dialog_filter)
/usr/lib64/python3.6/site-packages/urh/controller/dialogs/OptionsDialog.py: def on_radio_button_python2_interpreter_clicked(self, checked: bool):
Binary file /usr/lib64/python3.6/site-packages/urh/controller/dialogs/pycache/OptionsDialog.cpython-36.opt-2.pyc matches
Binary file /usr/lib64/python3.6/site-packages/urh/controller/dialogs/pycache/OptionsDialog.cpython-36.pyc matches
Binary file /usr/lib64/python3.6/site-packages/urh/controller/dialogs/pycache/OptionsDialog.cpython-36.opt-1.pyc matches
/usr/lib64/python3.6/site-packages/urh/dev/gr/scripts/airspy_recv.py:#!/usr/bin/env python2
/usr/lib64/python3.6/site-packages/urh/dev/gr/scripts/bladerf_recv.py:#!/usr/bin/env python2
/usr/lib64/python3.6/site-packages/urh/dev/gr/scripts/bladerf_send.py:#!/usr/bin/env python2
/usr/lib64/python3.6/site-packages/urh/dev/gr/scripts/funcube_recv.py:#!/usr/bin/env python2
/usr/lib64/python3.6/site-packages/urh/dev/gr/scripts/hackrf_recv.py:#!/usr/bin/env python2
/usr/lib64/python3.6/site-packages/urh/dev/gr/scripts/hackrf_send.py:#!/usr/bin/env python2
/usr/lib64/python3.6/site-packages/urh/dev/gr/scripts/rtl-sdr_recv.py:#!/usr/bin/env python2
/usr/lib64/python3.6/site-packages/urh/dev/gr/scripts/sdrplay_recv.py:#!/usr/bin/env python2
/usr/lib64/python3.6/site-packages/urh/dev/gr/scripts/usrp_recv.py:#!/usr/bin/env python2
/usr/lib64/python3.6/site-packages/urh/dev/gr/scripts/usrp_send.py:#!/usr/bin/env python2
/usr/lib64/python3.6/site-packages/urh/dev/gr/AbstractBaseThread.py: if os.path.isfile(os.path.join(gnuradio_dir, "gr-python27", "pythonw.exe")):
/usr/lib64/python3.6/site-packages/urh/dev/gr/AbstractBaseThread.py: self.python2_interpreter = os.path.join(gnuradio_dir, "gr-python27", "pythonw.exe")
/usr/lib64/python3.6/site-packages/urh/dev/gr/AbstractBaseThread.py: self.python2_interpreter = os.path.join(gnuradio_dir, "gr-python27", "python.exe")
/usr/lib64/python3.6/site-packages/urh/dev/gr/AbstractBaseThread.py: self.python2_interpreter = constants.SETTINGS.value("python2_exe", "")
/usr/lib64/python3.6/site-packages/urh/dev/gr/AbstractBaseThread.py: if not self.python2_interpreter:
/usr/lib64/python3.6/site-packages/urh/dev/gr/AbstractBaseThread.py: options = [self.python2_interpreter, os.path.join(rp, filename),
Binary file /usr/lib64/python3.6/site-packages/urh/dev/gr/pycache/AbstractBaseThread.cpython-36.opt-2.pyc matches
Binary file /usr/lib64/python3.6/site-packages/urh/dev/gr/pycache/AbstractBaseThread.cpython-36.pyc matches
Binary file /usr/lib64/python3.6/site-packages/urh/dev/gr/pycache/AbstractBaseThread.cpython-36.opt-1.pyc matches
/usr/lib64/python3.6/site-packages/urh/dev/BackendHandler.py: python2_exe = constants.SETTINGS.value('python2_exe', '')
/usr/lib64/python3.6/site-packages/urh/dev/BackendHandler.py: if not python2_exe:
/usr/lib64/python3.6/site-packages/urh/dev/BackendHandler.py: self.__python2_exe = self.__get_python2_interpreter()
/usr/lib64/python3.6/site-packages/urh/dev/BackendHandler.py: constants.SETTINGS.setValue("python2_exe", self.__python2_exe)
/usr/lib64/python3.6/site-packages/urh/dev/BackendHandler.py: self.__python2_exe = python2_exe
/usr/lib64/python3.6/site-packages/urh/dev/BackendHandler.py: constants.SETTINGS.setValue("python2_exe", self.__python2_exe)
/usr/lib64/python3.6/site-packages/urh/dev/BackendHandler.py: def python2_exe(self):
/usr/lib64/python3.6/site-packages/urh/dev/BackendHandler.py: return self.__python2_exe
/usr/lib64/python3.6/site-packages/urh/dev/BackendHandler.py: @python2_exe.setter
/usr/lib64/python3.6/site-packages/urh/dev/BackendHandler.py: def python2_exe(self, value):
/usr/lib64/python3.6/site-packages/urh/dev/BackendHandler.py: if value != self.__python2_exe:
/usr/lib64/python3.6/site-packages/urh/dev/BackendHandler.py: self.__python2_exe = value
/usr/lib64/python3.6/site-packages/urh/dev/BackendHandler.py: constants.SETTINGS.setValue("python2_exe", value)
/usr/lib64/python3.6/site-packages/urh/dev/BackendHandler.py: if os.path.isfile(self.python2_exe) and os.access(self.python2_exe, os.X_OK):
/usr/lib64/python3.6/site-packages/urh/dev/BackendHandler.py: self.gnuradio_is_installed = call('"{0}" -c "import gnuradio"'.format(self.python2_exe),
/usr/lib64/python3.6/site-packages/urh/dev/BackendHandler.py: def __get_python2_interpreter(self):
/usr/lib64/python3.6/site-packages/urh/dev/BackendHandler.py: for prog in ["python2", "python2.exe"]:
Binary file /usr/lib64/python3.6/site-packages/urh/dev/pycache/BackendHandler.cpython-36.opt-2.pyc matches
Binary file /usr/lib64/python3.6/site-packages/urh/dev/pycache/BackendHandler.cpython-36.pyc matches
Binary file /usr/lib64/python3.6/site-packages/urh/dev/pycache/BackendHandler.cpython-36.opt-1.pyc matches
/usr/lib64/python3.6/site-packages/urh/ui/ui_options.py: self.lineEditPython2Interpreter.setPlaceholderText(_translate("DialogOptions", "/usr/bin/python2"))
Binary file /usr/lib64/python3.6/site-packages/urh/ui/pycache/ui_options.cpython-36.opt-2.pyc matches
Binary file /usr/lib64/python3.6/site-packages/urh/ui/pycache/ui_options.cpython-36.pyc matches
Binary file /usr/lib64/python3.6/site-packages/urh/ui/pycache/ui_options.cpython-36.opt-1.pyc matches
Platform Specifications
The text was updated successfully, but these errors were encountered: