0

I'm working on a project to read data from CAN bus ( Controller Area Network ). It's working well when I use the terminal, but when I try to create an application with pyinstaller it's not working anymore. I am using the Python-Can library, and my Hardware is from Vector.

import can
import binascii
import time
import logging
from PyQt5.QtCore import QThread
import matplotlib.pyplot as plt

class Bus_CAN(QThread):

    def __init__(self,Logger,ID,channel,CW_Mode,Key_ID):

        QThread.__init__(self)
        self.Channel = channel
        self.Result = []


        try :
            self.bus = can.interface.Bus( bustype='vector', channel = self.Channel)
            self.Connected = True
            print('CAN Connection OK !')


        except :
            self.Connected = False
            print('CAN Connection error !')

When I launch this application directly from SublimeText the connection is OK, But when I build an application with pyinstaller the connection is not OK.

Thanks for your help.

EDIT : I'm using pyinstaller, not Py2exe

Romain
  • 1
  • 1
  • have you included your packages into includes in setup file? – vi_me Mar 25 '19 at 15:16
  • Can you see if the Python version is not 3.6? Apparently, Release 3.6 changed the 'bytecode' structure such that py2exe will no longer work. You can download the binary version for the Python 3.5. – Raj Mehta Mar 25 '19 at 15:30
  • I'm using pyinstaller not Py2exe ( I corrected it in my post ), so I don't have setup file. – Romain Mar 25 '19 at 15:33
  • I tried with Python 3.5 but nothing change – Romain Mar 25 '19 at 16:46

0 Answers0