RSUDP install error no module named PyQt5

Hi, I am trying to run the rsudp and found this no module named “pyQt5” and import fail message. Should I be concerned about it and if so, what do I do? Below is the command to run and the message:


(rsudp) webgis-sendongs-MacBook-Pro:rsudp webgis_sendong$ rs-client -h
Qt import failed. Trying Tk…
detail: No module named ‘PyQt5’
/Users/webgis_sendong/miniconda3/envs/rsudp/lib/python3.7/site-packages/pydub/utils.py:170: RuntimeWarning: Couldn’t find ffmpeg or avconv - defaulting to ffmpeg, but may not work
warn(“Couldn’t find ffmpeg or avconv - defaulting to ffmpeg, but may not work”, RuntimeWarning)
/Users/webgis_sendong/miniconda3/envs/rsudp/lib/python3.7/site-packages/pydub/utils.py:184: RuntimeWarning: Couldn’t find ffplay or avplay - defaulting to ffplay, but may not work
warn(“Couldn’t find ffplay or avplay - defaulting to ffplay, but may not work”, RuntimeWarning)

###########################################

R A S P B E R R Y S H A K E

UDP Client

by Ian Nesbitt

Hello aalagmay, welcome to the community!

The immediate answer to this would be to install the pyQt5 module that seems to be missing from your environment with the following command:

pip install PyQt5

Here’s its documentation: https://pypi.org/project/PyQt5/

From how you worded your issue I think I understand when this has happened, but to check, has this issue presented itself after the rsudp installation or during it?

There is also an alert regarding ffmpeg and ffplay, not finding them. Those are important if you want to hear the audio alert sounds when an event is detected, so you could install them if needed.

Thank you Stormchaser, I will try to do the pip install PyQt5

I first encountered (saw) this problem during the rsudp installation. Also the ffmpeg and ffplay not being found also during the installation.

No problem, crossed fingers that everything will work well.

Regarding ffmpeg on Mac, the answers to this post can help you in installing it. First and second seem to be the best ones: https://superuser.com/questions/624561/install-ffmpeg-on-os-x

Hi Stormschaser,

I succesfuly installed PyQt5 using the command python3 -m pip install PyQt5 (see below). However when I reinstalled rsudp, it still brings out the message
Qt import failed. Trying Tk…
detail: No module named ‘PyQt5’

I am using a Macbook with a Catalina OS 10.15.6


webgis-sendongs-MacBook-Pro:bin webgis_sendong$ python3 -m pip install PyQt5
Collecting PyQt5
Downloading PyQt5-5.15.1-5.15.1-cp35.cp36.cp37.cp38.cp39-abi3-macosx_10_13_intel.whl (50.2 MB)
|████████████████████████████████| 50.2 MB 909 bytes/s
Collecting PyQt5-sip<13,>=12.8
Downloading PyQt5_sip-12.8.1-cp38-cp38-macosx_10_9_x86_64.whl (63 kB)
|████████████████████████████████| 63 kB 3.2 MB/s
Installing collected packages: PyQt5-sip, PyQt5
Attempting uninstall: PyQt5-sip
Found existing installation: PyQt5-sip 4.19.24
Uninstalling PyQt5-sip-4.19.24:
Successfully uninstalled PyQt5-sip-4.19.24
Successfully installed PyQt5-5.15.1 PyQt5-sip-12.8.1


Successfully installed matplotlib-3.1.1 oauthlib-3.1.0 pydub-0.24.1 python-telegram-bot-12.8 requests-oauthlib-1.3.0 rsudp-1.0.1 twython-3.8.2
rsudp has installed successfully!
Backing up old settings file…
cp: illegal option – -
usage: cp [-R [-H | -L | -P]] [-fi | -n] [-apvXc] source_file target_file
cp [-R [-H | -L | -P]] [-fi | -n] [-apvXc] source_file … target_directory
Installing new settings file…
Qt import failed. Trying Tk…
detail: No module named ‘PyQt5’
Creating a default settings file at /Users/webgis_sendong/.config/rsudp/rsudp_settings.json
Success.
You can enter the command “conda activate rsudp” to activate the rsudp conda environment
and then run rsudp by using the command “rs-client -h”
webgis-sendongs-MacBook-Pro:rsudp webgis_sendong$

Hello again aalagmay,

thank you for the update. From your shell, can you try these two commands?

conda activate rsudp

conda list

and see if the qt (or PyQt) package appears in the list?

If not, while still in the conda rsudp environment, can you try conda install -c anaconda pyqt?

After doing this another conda list should give you the package installed in the environment.

Hi Stormchaser,

I did run the conda list after conda activate rsudp. The qt (or PyQt) was not there. I followed your instruction to install -c anaconda pyqt in the rsudp environment and then did another conda list. Both qt and pyqt are now there. I hope it now works. Thanks.


Tried to run the rs-client and this is what it returned

Traceback (most recent call last):
File “/Users/webgis_sendong/miniconda3/envs/rsudp/bin/rs-client”, line 5, in
from rsudp.client import main
File “/Users/webgis_sendong/miniconda3/envs/rsudp/lib/python3.7/site-packages/rsudp/init.py”, line 17, in
version = pkg_resources.require(name)[0].version
File “/Users/webgis_sendong/miniconda3/envs/rsudp/lib/python3.7/site-packages/pkg_resources/init.py”, line 899, in require
needed = self.resolve(parse_requirements(requirements))
File “/Users/webgis_sendong/miniconda3/envs/rsudp/lib/python3.7/site-packages/pkg_resources/init.py”, line 790, in resolve
raise VersionConflict(dist, req).with_context(dependent_req)
pkg_resources.ContextualVersionConflict: (matplotlib 3.3.1 (/Users/webgis_sendong/miniconda3/envs/rsudp/lib/python3.7/site-packages), Requirement.parse(‘matplotlib==3.1.1’), {‘rsudp’})

You’re welcome, no problem at all.

Enjoy RSUDP, and remember to launch it always after activating its environment with

conda activate rsudp

I forgot the first times and wasted so much in trying to understand why it wasn’t working… like a pc that doesn’t turn on because the plug is missing :smiley: