Error on Python serial import
Question: When I try to import the serial I get the following error:

    
    
    Traceback (most recent call last):
      File "C:\Documents and Settings\eduardo.pereira\workspace\thgspeak\tst.py", line 7, in <module>
        import serial
      File "C:\Python27\lib\site-packages\serial\__init__.py", line 27, in <module>
        from serial.serialwin32 import Serial
      File "C:\Python27\lib\site-packages\serial\serialwin32.py", line 15, in <module>
        from serial import win32
      File "C:\Python27\lib\site-packages\serial\win32.py", line 182, in <module>
        CancelIoEx = _stdcall_libraries['kernel32'].CancelIoEx
      File "C:\Python27\lib\ctypes\__init__.py", line 375, in __getattr__
        func = self.__getitem__(name)
      File "C:\Python27\lib\ctypes\__init__.py", line 380, in __getitem__
        func = self._FuncPtr((name_or_ordinal, self))
    AttributeError: function 'CancelIoEx' not found
    

I have installed the latest version of pySerial, Python 2.7 runing on a WinXP
laptop. Tried everywhere and found no similar problem. Is there any solution
for that? Thanks in advance...


Answer: The version of pySerial that you're using is trying to call a
[function](https://github.com/pyserial/pyserial/commit/5a39b8897bbadb4b4e6da38a0cb557522bac3e1a)
that's only available in Windows Vista, whereas you're running Windows XP.

It might be worth experimenting with using an older version of pySerial.

The code in question was [added to pySerial on 3 May
2016](https://github.com/pyserial/pyserial/commit/5a39b8897bbadb4b4e6da38a0cb557522bac3e1a),
so a version just prior to that might be a good start.

