Search code examples
pythonpython-3.xraspberry-pi3libraries

ImportError of module libscrc on Raspberry Pi 3


I'm kinda new to Rpi's and I have a problem executing a library called libscrc with python (I use python3), I need this to calculate a crc checksum for my RS485 communication. On pycharm on my PC everything works fine, but when I implement this on my RPI3 I get errors, I already managed to install the pyserial library and this works fine, but I keep getting errors when trying to run libscrc (this is the link to the library: https://pypi.org/project/libscrc/ ). This is the error:

Traceback (most recent call last):
  File "Rs_485.py", line 1, in <module>
    import libscrc
  File "/home/pi/.local/lib/python3.6/site-packages/libscrc/__init__.py", line 14, in <module>
    from ._crcx  import *
ImportError: libpython3.6m.so.1.0: cannot open shared object file: No such file or directory

Can anyone help me? I already updated and upgraded the RPI. When I try the following test command

pi@raspberrypi:~/codes $ python -m libscrc.testmodbus

I get:

/usr/bin/python: No module named libscrc

And I'm using python3.6 by the way


Solution

  • Give it a try by using the github link of the libscrc project

    !pip install git+https://github.com/hex-in/libscrc.git
    

    It worked this way for me! cheers!