Using simply CAN python

Hello,

I’m trying to use the simply_py module and I’m not sure to know why it doesn’t work.
My laptop is under win 10 OS, 64bits.

Pythons versions are :
2.7.18 and 3.10.8

I have canAnalyser3 mini installed on this laptop, and simply_py.pyd already installed in the python27/lib folder.

While I start the demo.py file, it returns that the DLL load failed. I don’t know what DLL need to be started.
What files are really necessary into the laptop in order to run the simply_py.pyd python code ? Is a method like pip install simply_py ?

Thank you.

Hello @erwann ,

This is most likely an issue related to the simply_py.pyd not being compatible with your version of python. There are additional versions available in “.\lib\python”

The version in the demo folder are built for python 3.8 you should be able to run it as is if run with python 3.8. You can install python 3.8 from the windows store then launch with python3.8 Run the example should look something like python3.8 .\demo.py You might also be able to use py -3.8 demo.py

1 Like

Hello,

So I installed the 3.8 python version, put the different files into dll and lib folders, and launch the demo.py script. Result is the same :

C:\Users\430154\AppData\Local\Programs\Python\Python38-32\Lib>python demo.py
Traceback (most recent call last):
  File "demo.py", line 23, in <module>
    import simply_py as simply
ImportError: DLL load failed while importing simply_py: %1 is not a valid Win32 application.

When I open a cmd window, python --version returns : Python 3.8.7

thank you for helping me.

and :

C:\Users\430154\AppData\Local\Programs\Python\Python38-32\Lib>python3.8 .\demo.py

doesn’t work

The simply_py.py2-32.pyd version is for python 2 32bit. I also had the same ImportError: DLL load failed while importing simply_py: %1 is not a valid Win32 application. error I suspect this is because i have a 64 bit install of python 2 installed.
It seems like you are going about this in a different way I am not sure if the correct python version and simply_py.pyd is being used.

I have tested the default files in the samples/python directory and was able to run the example. It seems like you are moving the files into your python folder, this should not be necessary. The demo is looking for the simply_py.pyd file in the working directory.

After unzipping the simplyCAN_WIN_… folder you should be able to open a terminal in samples/python . running py -3.8 .\demo.py should run the example with python 3.8

While USB-to-CAN connected to CAN network, return was the same :

simplyCAN Demo 1.0 (c) 2018-2019 HMS

Error: Command response timeout reached

Is a compatibility with a the USB-to-CAN version ? I use the 1.01.0087.10100 (an old version).

Hello,
I re install an other python version (3.8.10 amd64), and it seemed to be better. Here is the result…

C:\Users\430154\Desktop\TrainLab\Innovation\11 - CAN converter\simplyCAN_WIN_1_1_0\simplyCAN_WIN_1_1_0\samples\python>demo.py

#### simplyCAN Demo 1.0 (c) 2018-2019 HMS ####

Error: Command response timeout reached

The USB-to-CAN was not connected to the CAN network…

Hello,

So with an younger simplyCAN USB to CAN box, the python code works properly !

Good !

Sorry for the delay I was out Friday.

Yes, a SimplyCAN device is required for the SimplyCAN python examples. The USB-to-CAN devices are do not work with these examples as they use the VCI driver and that API.