简体   繁体   English

Raspberry Pi 3 上模块 libscrc 的导入错误

[英]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.我对 Rpi 有点陌生,我在使用 python(我使用 python3)执行一个名为 libscrc 的库时遇到问题,我需要它来计算我的 RS485 通信的 crc 校验和。 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/ ).在我的 PC 上的 pycharm 上一切正常,但是当我在 RPI3 上实现它时出现错误,我已经设法安装了 pyserial 库并且它工作正常,但是在尝试运行 libscrc 时我不断收到错误(这是指向图书馆: 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.我已经更新并升级了 RPI。 When I try the following test command当我尝试以下测试命令时

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

I get:我得到:

/usr/bin/python: No module named libscrc /usr/bin/python: 没有名为 libscrc 的模块

And I'm using python3.6 by the way顺便说一下,我正在使用 python3.6

Give it a try by using the github link of the libscrc project使用 libscrc 项目的 github 链接试一试

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

It worked this way for me!它对我来说是这样的! cheers!干杯!

The answer was found!答案找到了! Hope this wil help anyone out with the same problem!希望这会帮助任何人解决同样的问题!

Use this command!:使用这个命令!:

sudo apt-get install libpython3.6

this did the job for me!这对我有用! :) :)

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM