snap7在linux怎么用,can't find snap7 library - linux

I'm running Rapbian on a Raspberry Pi Revision B.

I downloaded the module python-snap7 as instructed on this webpage: Snap7 Installation

I tried it twice: One time using pip and another doing it manually.

However, I installed it then via setup.py build and then setup.py install.

If i try to create a client, I get the following error:

Python 2.7.3 (default, Mar 18 2014, 05:13:23)

[GCC 4.6.3] on linux2

Type "help", "copyright", "credits" or "license" for more information.

>>> import snap7

>>> c = snap7.client.Client()

Traceback (most recent call last):

File "", line 1, in

File "/usr/local/lib/python2.7/dist-packages/snap7/client.py", line 29, in __init__

self.library = load_library()

File "/usr/local/lib/python2.7/dist-packages/snap7/common.py", line 48, in load_library

return Snap7Library(lib_location).cdll

File "/usr/local/lib/python2.7/dist-packages/snap7/common.py", line 40, in __init__

raise Snap7Exception(msg)

snap7.exceptions.Snap7Exception: can't find snap7 library. If installed, try running ldconfig

I did the following after getting this error:

I added some lines to the file so it looks like the following:

include /etc/ld.so.conf.d/*.conf

include /usr/local/lib/python2.7/dist-packages/snap7-full-1.2.1/

include /usr/local/lib/python2.7/dist-packages/snap7-full-1.2.1/release/Linux/ARMHF/Raspberry/

include /usr/local/lib/python2.7/dist-packages/snap7-full-1.2.1/src/lib/

include /usr/local/lib/python2.7/dist-packages/snap7-python/build/lib.linux-armv6l-2.7/snap7/

include /usr/local/lib/python2.7/dist-packages/snap7-python/

Then I issued the command sudo ldconfig to update the cache file /etc/ld.so.cache, but the error stays :(

Is it right to have the include instruction in fornt of each line?

Is there any kind of critical error I just don't see?

Which library do i need to include ?

I just thought of the provided ones over here: SourceForge Link. I have choosen the first .tar.gz package.

Sorry for my english and thanks in advance!

  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值