osdir.com


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Pyserial for Python3 in OSX?


I need to do some serial I/O on a Mac running OSX Mavericks. I followed the instructions at

http://stackoverflow.com/questions/20082935/how-to-install-pip-for-python3-on-mac-os-x

to install pyserial. OSX already had Python 2.7 and pyserial seems to work okay in 2.7, but I can't figure out how to get to run in 3.3.3 or 3.3.4.

After I install pyserial, in python 2.7 I can get this:

Python 2.7.5 (default, Sep 12 2013, 21:33:34) 
[GCC 4.2.1 Compatible Apple LLVM 5.0 (clang-500.0.68)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> from serial.tools import list_ports
>>> list_ports.comports()
[['/dev/cu.Bluetooth-Incoming-Port', 'n/a', 'n/a'], ['/dev/cu.Bluetooth-Modem', 'n/a', 'n/a'], ['/dev/cu.usbserial-AH012QEW', 'FT232R USB UART', 'USB VID:PID=403:6001 SNR=AH012QEW']]
>>> quit()

In Python 3, I get this:

Python 3.3.4 (default, Feb 15 2014, 21:28:44) 
[GCC 4.2.1 Compatible Apple LLVM 5.0 (clang-500.2.79)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> from serial.tools import list_ports
>>> list_ports.comports()
[]
>>> quit()


I see all sorts of messages around the web suggesting similar problems getting Python 3 on a Mac to talk to serial ports but I can't find any fixes. Is there a trick I haven't found yet? Many thanks in advance for a cure.

Howard