Import Error: no module named serial

496 views
Skip to first unread message

Mark Penner

unread,
Mar 28, 2013, 6:56:12 PM3/28/13
to kivy-...@googlegroups.com
Hi all,
I'm trying to use Kivy as a medium between a joystick and an Arduino.  My basic Python test programs to talk to the Arduino using pyserial work, but when I add the line "import serial" to a kivy program, it returns an import error "Import Error: No module named serial".  Other outside packages like pygame seem to work inside kivy...

I have no idea what could be going on, any thoughts?

Thanks,
Mark

Thomas Pietrowski

unread,
Apr 8, 2013, 2:53:27 AM4/8/13
to kivy-...@googlegroups.com
You need to add the serial module to your project or install it via python-for-android. But I'm not sure it is included as a recipe in the compilation script.
As PySerial is fully arch-independent as it is written in python, you can for the beginning add it to the project folder as I did for my project using the Kivy launcher.

Don't forget to use a xterm to find out, how the arduino is named in /dev/tty*.

Mark Penner

unread,
Apr 8, 2013, 1:21:59 PM4/8/13
to kivy-...@googlegroups.com
The pyserial folder is in the project folder and Pyserial works when the script is run from the interpreter, but not when run through kivy.  Any time I add the line 'import serial' to a program and send it to kivy, it spits out an error.  Are you saying that I need to do something with filepaths so that kivy knows where to look?  Copying the Pyserial folder to the kivy\python\include\ folder didn't do anything, but I have no idea if that's what you meant.

Thanks for the reply!



--
You received this message because you are subscribed to a topic in the Google Groups "Kivy users support" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/kivy-users/VBbzCIsYHes/unsubscribe?hl=en.
To unsubscribe from this group and all its topics, send an email to kivy-users+...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.



Reply all
Reply to author
Forward
0 new messages