sparrow-wifi icon indicating copy to clipboard operation
sparrow-wifi copied to clipboard

qtchart error

Open awesome14 opened this issue 5 years ago • 5 comments

I get this error: File "sparrow-wifi.py", line 37, in from PyQt5.QtChart import QChart, QChartView, QLineSeries, QValueAxis ImportError: No module named 'PyQt5.QtChart'

I'm using debian stretch. I followed the read me. I'm running sparrow-wifi.py as sudoer.

awesome14 avatar Jun 27 '19 02:06 awesome14

Sounds like something is up with your pyqtchart install. Give this a shot and see what it says: "pip3 search pyqtchart".

You should get a response something like: PyQtChart (5.12) - Python bindings for the Qt Charts library INSTALLED: 5.12 (latest)

If it's installed correctly, from a command line you should be able to just simply do "python3" then type "from PyQt5.QtChart import QChart", or even more generically (just for testing) try "import PyQt5.QtChart". If you get any errors, sounds like some local install troubleshooting.

ghostop14 avatar Jun 29 '19 13:06 ghostop14

From the first command I get: "PyQtChart (5.13.0) - Python bindings for the Qt Charts library"

From the second commands I get: Traceback (most recent call last): File "", line 1, in ImportError: No module named 'PyQt5.QtChart'

I can look into it, but I thought you should be aware of it. If you have a one-liner to solve it, let me know.

awesome14 avatar Jul 18 '19 13:07 awesome14

I assume you are using a virtualenv if so:

The issue is likely due to running the script as root the the virtualenv environment variables, aliases, functions, etc aren't being carried over.

Fix: When you run the script tell it to use the path to the virtualenv e.g. sudo /home/user/sparrow/bin/python3 sparrow-wifi.py

JoshOxford avatar Aug 14 '19 11:08 JoshOxford

Thanks Josh, This solved it for me: Fix: When you run the script tell it to use the path to the virtualenv e.g. sudo /home/user/sparrow/bin/python3 sparrow-wifi.py

rikosintie avatar Dec 26 '19 06:12 rikosintie

Thanks Josh, This solved it for me: Fix: When you run the script tell it to use the path to the virtualenv e.g. sudo /home/user/sparrow/bin/python3 sparrow-wifi.py

Close this =)

stryngs avatar May 20 '21 07:05 stryngs