setup guidelines needed for python beginner on Raspberry pi

61 views
Skip to first unread message

Marcel van der Heide

unread,
Apr 13, 2020, 8:58:25 AM4/13/20
to SoCo - Sonos Controller
Hi,
Thanks for this soco Controller.

I have my home automation system (Domoticz) and i have several Sonos speakers in the house.

Before i was able to use SoCo to do the following:
1: When the TV is playing, the playbar is removed from the group and plays TV sound.
After the TV watching is over, it is very silent in the living room so i want the Playbar back to a predefined volume and back into the group.
2: At night, all volumes are put back to a normal volume and grouped to the default player (office). So when i switch on the system in the morning, it will not be very loud because anyone in the house put the volume up.

This was working very well before, but after I have rebuild my Raspberry Pi system, I cannot get soco to work at all.
I have tried the pip install, I have tried the manual install but when i use the python interpreter and type import soco i get No module named soco.

I remember from the first time that i had a lot of trouble too, to get a file to run.
In the interpreter it went fine but running it from the shell it did not easily work.

Maybe someone can guide me through the basic steps that are shurely missing but because i am not a python developer, i miss it.

Thanks in advance,

Marcel van der Heide

Kenneth Nielsen

unread,
Apr 17, 2020, 3:14:10 AM4/17/20
to SoCo - Sonos Controller
Hi Marcel

I'm sorry, but I have a tiny bit of time so I will just drop a few pointers for you to google and try out. AFAIK there is nothing special about soco, so I think you can regard this as a general install and use problem. Most common cases when a package cannot be imported are:

1) Path import issues i.e. is the interpreter looking in the right places for the new package. You can see all search paths with:

import sys
print(sys.path)

I think pip tells you which folder it copies files to, so that should make it possible to see whether that folder is in the path.

2) Major version mixup. Since the extremely slowly moving transition from python2 to python3 it is possible to get them mixed up. Operating system typically has a executable which is called just "python", but does that point to python2 or python3 and, same thing for pip. There is now such a thing as pip3, I don't remember if there is also a pip2, but there is a pip. So is pip just always pip for python2 or is it similary a sym link to one or the other. Point of all this is that maybe it got installed in one version of python but you are running the other one.

Otherwise as I said. It think the problem here is not soco specific, so you could also try and look around the net.

Marcel van der Heide

unread,
Apr 17, 2020, 3:29:49 AM4/17/20
to SoCo - Sonos Controller
Hi Kenneth,

Thanks for your reply!

I am pretty sure it is not SoCo related and I will follow your suggestions.
When i find a solution i will add it to this message.

Met hartelijke groet / kind regards,

Marcel van der Heide

Kenneth Nielsen

unread,
Apr 17, 2020, 4:09:13 AM4/17/20
to SoCo - Sonos Controller
I should mention, that when I mentioned searching for it, that it is not because you can't ask general installation questions here. It is just that this group may not be the most active for that. There is a "Python Developers" Slack channel which is very active and really good for this sort of thing.

\Kenneth
Reply all
Reply to author
Forward
0 new messages