fotoartist78
Posts: 48
Joined: Fri Apr 08, 2016 1:10 pm

Installng Python-osc on Rpi3

Tue Jun 27, 2017 3:27 pm

I have been trying to follow the project Ultrasonic Theremin shown in the Raspbery Pi resources. It uses Sonic Pi and Python to interact, it uses a Python library 'python-osc from which the python script imports two modules. I have tried to install the Python-Osc library and it appears to install OK. However when I try to compile a script Python throws an error at the import line 'Error - module no found'. Can any one tell me the correct way to install the library and then check that it is present.?

DirkS
Posts: 10497
Joined: Tue Jun 19, 2012 9:46 pm
Location: Essex, UK

Re: Installng Python-osc on Rpi3

Tue Jun 27, 2017 3:32 pm

How did you install it (exact command)?
Do you want to use it with python 2 or 3?

To install it for python 3 with pip you need to use

Code: Select all

sudo pip3 install python-osc

User avatar
B.Goode
Posts: 10880
Joined: Mon Sep 01, 2014 4:03 pm
Location: UK

Re: Installng Python-osc on Rpi3

Tue Jun 27, 2017 3:56 pm

Can any one tell me the correct way to install the library and then check that it is present.?
What @DirkS said corresponds with what it says in the software Resources for that project:

https://www.raspberrypi.org/learning/ul ... /software/

To test it, simply follow the instructions at Step 4 Sending notes from Python in the main tutorial: https://www.raspberrypi.org/learning/ul ... worksheet/

Note that at Step 2 Detecting distance you are required to use Python3 for this project.

If you still have trouble post the entire error message you are getting so that someone can interpret it for you.

fotoartist78
Posts: 48
Joined: Fri Apr 08, 2016 1:10 pm

Re: Installng Python-osc on Rpi3

Tue Jun 27, 2017 7:21 pm

Many thanks Dirk and Mr Goode for quick replies to my query. I think DIrk has supplied the correct form of command to enter to install the Library. I had simply entered " pip install python-osc" , I had missed the sudo pip3 part of the command so that is probably why I got the run-time error message . I will try again tomorrow with correct command. Would I need to remove any garbage that my attempt made before I try again.?

DirkS
Posts: 10497
Joined: Tue Jun 19, 2012 9:46 pm
Location: Essex, UK

Re: Installng Python-osc on Rpi3

Tue Jun 27, 2017 7:37 pm

fotoartist78 wrote:Would I need to remove any garbage that my attempt made before I try again.?
You can, but it's not essential. Modules for Python 2 and 3 are installed in a different directory.

Return to “Python”