Python Forum

Full Version: Missing Python Library
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Hi everyone:)
I'm playing around with my raspberry, precisly I'm trying to retrieve some info from the mic with python.
I found this library which appears to be perfect to do what I want to do, I installed it but when I try to launch it by typing from the command line I get the error "missing module", so I tried to verify the installation and the command line also says to me that the module is alredy there.
What should I do?

enter the following on command line and post results:
python -V
which python
pip -V
pip list
Here we go
and the missing module name?
From the output in the first post it looks like they try to use soundmeter
Yes absolutly, I'm trying to use soundmeter but every time I try to launch it it shows
"Traceback (most recent call last):
File "/usr/local/sbin/soundmeter", line 6, in <module>
from soundmeter import main
File "/usr/local/sbin/soundmeter.py", line 6, in <module>
from soundmeter.meter import main
ImportError: No module named meter"
Why is your script "soundmeter" in /usr/local/sbin?

The problem is, that you call your script soundmeter.py
Rename it and the problem will disappear.
Honestly I don't know, I just followed the istructions on GitHub at this link https://pypi.org/project/soundmeter/

It doesn't seem to work unfortunately


Quote:pi@raspberrypi:/usr/local/sbin $ ls
soundmeter soundmeter.pyc
pi@raspberrypi:/usr/local/sbin $ sudo mv soundmeter soundmeterScript
pi@raspberrypi:/usr/local/sbin $ ls
soundmeter.pyc soundmeterScript
pi@raspberrypi:/usr/local/sbin $ soundmeter
Traceback (most recent call last):
File "/usr/sbin/soundmeter", line 6, in <module>
from soundmeter.meter import main
File "/home/pi/.local/bin/soundmeter.py", line 6, in <module>
ImportError: No module named meter
pi@raspberrypi:/usr/local/sbin $ python soundmeterScript
Traceback (most recent call last):
File "soundmeterScript", line 6, in <module>
from soundmeter import main
File "/usr/local/sbin/soundmeter.py", line 6, in <module>
ImportError: No module named meter
You have not followed what @DeaD_EyE suggest.
To make it clear rename/delete /usr/local/sbin/soundmeter.py in this placement.

It's shadowing the real one that's need to be called in:
/usr/lib/python2.7/dist-packages/soundmeter.py