Menu

#161 Pyserial 2.7 cannot be installed on a Python 3.3 installation

v2.7
closed-fixed
5
2015-09-22
2014-04-09
Eric ALBER
No

I'm trying to use pyserial 2.7 with Python 3.3 on Ubuntu 13.10.

I downloaded the sources and installed pyserial with the following command:

python3 setup.py install

I got the following warning:

/usr/lib/python3.3/distutils/dist.py:257: UserWarning: Unknown distribution option: 'use_2to3'

then when I 'import serial', I get the following error:

>>> import serial
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "./serial/__init__.py", line 21, in <module>
    from serial.serialposix import *
  File "./serial/serialposix.py", line 58
    except IOError, e:
              ^
SyntaxError: invalid syntax

It looks like 3to3 hasn't been applied

if I run

find serial -name "*.py" -exec 2to3 -n -w --no-diffs {} \;
python3 setup.py install

pyserial works properly

Related

Patches: #35

Discussion

  • Gustavo Velasco-Hernández

    Installing using apt-get install python3-serial also works.

     
  • Chris Liechti

    Chris Liechti - 2015-09-22

    please try v3.0a0 from https://github.com/pyserial/pyserial/releases where Python 3 support was improved

     
  • Chris Liechti

    Chris Liechti - 2015-09-22
    • status: open --> closed-fixed
    • assigned_to: Chris Liechti
     

Log in to post a comment.