Hi Everyone,

I am trying to communicate with a Siemens S7-1200 PLC, I have installed the snap7 library using cmd by using "pip install python-snap7". It was successful, I import already in the pycharm. and when i execute the script i get error as below:

Traceback (most recent call last):
File "C:/Users/DMCP-PC1/PycharmProjects/snap7/", line 5, in <module>
plc = snap7.client.Client()
File "C:\Users\DMCP-PC1\PycharmProjects\snap7\snap7\", line 37, in __init__
self.library = load_library()
File "C:\Users\DMCP-PC1\PycharmProjects\snap7\snap7\", line 54, in load_library
return Snap7Library(lib_location).cdll
File "C:\Users\DMCP-PC1\PycharmProjects\snap7\snap7\", line 46, in __init__
raise Snap7Exception(msg)
snap7.snap7exceptions.Snap7Exception: can't find snap7 library. If installed, try running ldconfig

How can i solve this?

Advance thanks.

Comment actions Permalink


Does it happen only when running it from PyCharm?
How does it go when you run it from the cmd prompt using the same interpreter?

Comment actions Permalink

Hi Sergey Karpov

I have tried executing it using cmd prompt, still gives the same error as mentioned in the post.

just for the info I am using Windows 10, 64bit. I saw in the online tutorials, they used pycharm in windows platform to communicate with Siemens S7-1200.

Not sure where I am making the mistake.


Thank you

Comment actions Permalink

So the problem is not related to PyCharm.

It's better to ask on the corresponding forums in such cases.

For example, I found this one

and this one


Please sign in to leave a comment.