Import Socket error

Hi,

I keep getting this error when running my FTP script.

ImportError: Error loading module FTP: Traceback(most recent call last):
File "C:\Program Files\Inductive Automation\Ignition\user-lib\pylib\ftplib.py", line 47 in import socket
File "C:\Program Files\Inductive Automation\Ignition\user-lib\pylib\socket.py", line 3 in from _socket import(File "C:\Program Files\Inductive Automation\Ignition\user-lib\pylib_socket.py", line 2, in import encodings.idna
ImportError:No module named idna

See if you have a copy of idna.py in C:\Program Files\Inductive Automation\Ignition\user-lib\pylib\encodings\.

yes we have that file in that folder

Did you ever manage to find a solution?

I am trying to import socket on a tag event script and it is doing the same thing...

([default]Test/Client/Command, valueChanged) Error executing tag event script: Traceback (most recent call last): File "tagevent:valueChanged", line 2, in valueChanged File "C:\Program Files\Inductive Automation\Ignition\user-lib\pylib\socket.py", line 3, in from _socket import ( File "C:\Program Files\Inductive Automation\Ignition\user-lib\pylib_socket.py", line 2, in import encodings.idna ImportError: No module named idna

I too have that file in that folder

This is the sort of trouble that makes me recommend never using python stdlib networking in jython. Use java sockets.

1 Like

Gotcha, is this a python problem or an Ignition problem?

It works fine on a vision button press event script just not the tag event script…

Interestingly it works on a gateway tag change script!