hardbyte / python-can

The can package provides controller area network support for Python developers
https://python-can.readthedocs.io
GNU Lesser General Public License v3.0
1.26k stars 599 forks source link

python-can fails when using PCAN at newest version #74

Closed hardbyte closed 7 years ago

hardbyte commented 8 years ago

Originally reported by: Alex Eshoo (Bitbucket: AlexEshoo, GitHub: AlexEshoo)


When I try to run a script using the PCAN device, I get an exception: File ".\can_test.py", line 4, in <module> bus = can.interface.Bus(bitrate = 125000) File "C:\Python27\lib\site-packages\can\interfaces\interface.py", line 48, in __new__ from can.interfaces.pcan import PcanBus File "C:\Python27\lib\site-packages\can\interfaces\pcan.py", line 10, in <module> from can.interfaces.PCANBasic import * File "C:\Python27\lib\site-packages\can\interfaces\PCANBasic.py", line 8, in <module> from can.interfaces.pcan_constants import * File "C:\Python27\lib\site-packages\can\interfaces\pcan_constants.py", line 5, in <module> TPCANHandle = c_ubyte # Represents a PCAN hardware channel handle NameError: name 'c_ubyte' is not defined


hardbyte commented 8 years ago

Original comment by Brian Thorne (Bitbucket: hardbyte, GitHub: hardbyte):


Great! Thanks for testing that out.

hardbyte commented 8 years ago

Original comment by luator (Bitbucket: luator, GitHub: luator):


Thanks for pointing this out. I have used the source from https://pypi.python.org/pypi/python-can which is version 1.5.0 (I didn't have success using pip under windows yet). Now I reinstalled it, using the newest revision from the "default" branch (version 1.5.1) and the error is gone :) So I guess this ticket can be closed.

hardbyte commented 8 years ago

Original comment by Brian Thorne (Bitbucket: hardbyte, GitHub: hardbyte):


Yeah it should - but I haven't cut a new release in a while. Are you installing python-can from pip or from source?

hardbyte commented 8 years ago

Original comment by Christian Sandberg (Bitbucket: sandberg, GitHub: sandberg):


Wouldn't 5c7e01c fix this?

hardbyte commented 8 years ago

Original comment by luator (Bitbucket: luator, GitHub: luator):


Same problem for me. In case it matters, I am using Windows 10.