python 2.7 - can't find snap7 library - linux -



python 2.7 - can't find snap7 library - linux -

i'm running rapbian on raspberry pi revision b.

i downloaded module python-snap7 instructed on webpage: snap7 installation

i tried twice: 1 time using pip , doing manually. however, installed via setup.py build , setup.py install.

if seek create client, next error:

python 2.7.3 (default, mar 18 2014, 05:13:23) [gcc 4.6.3] on linux2 type "help", "copyright", "credits" or "license" more information. >>> import snap7 >>> c = snap7.client.client() traceback (most recent phone call last): file "<stdin>", line 1, in <module> 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 homecoming 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, seek running ldconfig

i did next after getting error:

i added lines file looks 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 issued command sudo ldconfig update cache file /etc/ld.so.cache, error stays :(

is right have include instruction in fornt of each line? is there kind of critical error don't see? which library need include ? thought of provided ones on here: sourceforge link. have choosen first .tar.gz package.

sorry english language , in advance!

looks didn't install snap7 library (it's not included in python-snap7)

to utilize snap7 library on raspberry pi python-snap7 wrapper need followed steps:

download snap7 library illustration snap7-full-1.2.1 in pi command line: wget http://sourceforge.net/projects/snap7/files/1.2.1/snap7-full-1.2.1.tar.gz/download

unzip downloaded file in pi command line: tar -zxvf snap7-full-1.2.1.tar.gz

compile library raspberry (example rpi 1 rpi 2 utilize arm_v7_linux.mk)in pi command line: cd snap7-full-1.2.1/build/unix sudo create -f arm_v6_linux.mk all

copy compiled library lib directoriesin pi command line: sudo cp ../bin/arm_v6-linux/libsnap7.so /usr/lib/libsnap7.so sudo cp ../bin/arm_v6-linux/libsnap7.so /usr/local/lib/libsnap7.so (optional) install python pip if don't have itin pi command line: sudo apt-get install python-pip instal python wraper snap7 libin pi command line: sudo pip install python-snap7

linux python-2.7 module raspbian plc

Comments

Popular posts from this blog

php - Android app custom user registration and login with cookie using facebook sdk -

django - Access session in user model .save() -

php - .htaccess Multiple Rewrite Rules / Prioritizing -