0

I am completely new to Python and try to run the example code 'Working with MDF' of a library called 'asammdf' (code can be found here: https://asammdf.readthedocs.io/en/master/examples.html)

When I run the .py-script I get the following error message:

WARNING:root:Signal plotting requires pyqtgraph or matplotlib Traceback (most recent call last): File "/Users/martin/PycharmProjects/mdfp3/WorkingWithMDF.py", line 46, in mdf4_cut.get('Float64_Signal').plot()

I added the pyqtgraph and matplotlib packages using the dependency manager in PyCharm, but no luck.

What am I doing wrong?

Edit: Running the pip install commands for the packages results in 'Requirement already satisfied' statements (see below)

(venv) martins-mbp-2:mdfp3 martin$ pip install pyqtgraph Requirement already satisfied: pyqtgraph in ./venv/lib/python3.7/site-packages (0.10.0) Requirement already satisfied: numpy in ./venv/lib/python3.7/site-packages (from pyqtgraph) (1.17.4)

and

(venv) martins-mbp-2:mdfp3 martin$ pip install matplotlib Requirement already satisfied: matplotlib in ./venv/lib/python3.7/site-packages (3.1.1) Requirement already satisfied: cycler>=0.10 in ./venv/lib/python3.7/site-packages (from matplotlib) (0.10.0) Requirement already satisfied: numpy>=1.11 in ./venv/lib/python3.7/site-packages (from matplotlib) (1.17.4) Requirement already satisfied: python-dateutil>=2.1 in ./venv/lib/python3.7/site-packages (from matplotlib) (2.8.1) Requirement already satisfied: pyparsing!=2.0.4,!=2.1.2,!=2.1.6,>=2.0.1 in ./venv/lib/python3.7/site-packages (from matplotlib) (2.4.5) Requirement already satisfied: kiwisolver>=1.0.1 in ./venv/lib/python3.7/site-packages (from matplotlib) (1.1.0) Requirement already satisfied: six in ./venv/lib/python3.7/site-packages (from cycler>=0.10->matplotlib) (1.13.0) Requirement already satisfied: setuptools in ./venv/lib/python3.7/site-packages/setuptools-40.8.0-py3.7.egg (from kiwisolver>=1.0.1->matplotlib) (40.8.0)

3
  • 1
    The only thing we can know is what the error tells you: You need to have matplotlib or pyqtgraph installed. Commented Nov 13, 2019 at 16:59
  • "No luck" as in "I had no luck installing them" or "I installed them but get exactly the same error"? Commented Nov 13, 2019 at 17:12
  • @FiddleStix thanks for support, but it looks like the packages are installed (please see what I added). Commented Nov 13, 2019 at 17:15

1 Answer 1

2

It turns out that you need PyQt5 as well as either pyqtgraph or matplotlib. The GUI packages are considered 'optional', which would explain why they don't get installed automatically. FYI, I found this out by reading the exception in the asammdf\gui\plot.py file.

The GUI dependecies can be installed using this pip command

pip install asammdf[gui]
Sign up to request clarification or add additional context in comments.

3 Comments

The problem is that I expected that pyqtgraph had PyQt as dependency. I will address this in the setup file
@danielhrisca I've never bumped into a package maintainer on here. Kudos to you for being on the ball. Do you have an alert set up or something?
I'm a member of the Night's Watch keeping a vigilent eye out for trouble

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.