jdf / Processing.py-Bugs

A home for all bugs and feature requests about Python Mode for the Processing Development Environment.
41 stars 8 forks source link

import serial (pyserial) #164

Closed gratefulfrog closed 8 years ago

gratefulfrog commented 8 years ago

Hi,

I don't know if this is a bug, but I cannot seem to import serial even though it is installed in both python2.7 and 3 on my system:

import serial

def setup():
    None

results in: processing.app.SketchException: ImportError: No module named serial

Yet, at the Linux command line all is fine in both python2.7 and 3

$ python2.7
Python 2.7.10 (default, Oct 14 2015, 16:09:02) 
[GCC 5.2.1 20151010] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import serial
>>> 
$ python3
Python 3.5.1 (default, Apr 10 2016, 14:34:46) 
[GCC 5.2.1 20151010] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import serial
>>> 

Any help would be greatly appreciated.µ Ciao, Bob

jdf commented 8 years ago

Python Mode doesn't use cPython, or your system's Python standard library.

gratefulfrog commented 8 years ago

Is there any way to use the serial library, or other standard libraries?

jdf commented 8 years ago

Anything that's pure python can be copied into your sketch folder. There's no facility for a shared or standard Python language library for Python Mode, unfortunately.

gratefulfrog commented 8 years ago

So, I guess you mean that there is no easy way to use pyserial? ( https://pypi.python.org/pypi/pyserial) Or any of the other more complex modules?

jdf commented 8 years ago

There is no way to use any Python module that has a C language component.

gratefulfrog commented 8 years ago

thanks again

gratefulfrog commented 8 years ago

Hi,

Well after some research in this forum and on the micropython forum, I was able to get pyserial to work with Processing.py!

Check out the details in this post: http://forum.micropython.org/viewtopic.php?f=2&t=1840&p=11101#p11101

Thanks for all your help!!!

Ciao, Bob

On Fri, May 27, 2016 at 12:05 AM, Grateful Frog gratefulfrog@gmail.com wrote:

thanks again, sorry to be so ignorant... Ciao, Bob

On Thu, May 26, 2016 at 9:20 PM, Jonathan Feinberg < notifications@github.com> wrote:

There is no way to use any Python module that has a C language component.

— You are receiving this because you authored the thread. Reply to this email directly or view it on GitHub https://github.com/jdf/Processing.py-Bugs/issues/164#issuecomment-221968129