Unable to import module named xlrd

Good morning,

I am trying to add a 3rd party module to Ignition called xlrd. However, when I go to run my script the module is not found.

This link here suggests changing the module location:

I can then import the module from the script Console but not the script I am running.

Any help with what I am doing wrong is appreciated.

What version of xlrd did you download?
Also what version of Ignition are you using?

You may also have to restart your designer to get a local copy. I don't quite remember.

1 Like

Bear in mind that I was only able to get it to work properly in v8. I never had any success in 7.9.

Whoops!Just sunk in what your issue is. Where are you trying to run the script from? And where did you install xlrd?

Hello,

I installed the folder you attached here:
C:\Program Files\Inductive Automation\Ignition\user-lib\pylib

I then went to my script console and typed in “import xlrd”
Error message in script console: ImportError: No module named xlrd

If I can get that to work I’ll try the script again.

you need a site-packages folder.
C:\Program Files\Inductive Automation\Ignition\user-lib\pylib\site-packages

2 Likes

That seemed to work for the console and the script I was running. I got my original info from here…

https://support.inductiveautomation.com/index.php?/Knowledgebase/Article/View/98/2/importing-and-using-3rd-party-python-libraries-in-ignition

Do I need to put the folder in both locations or just the site-packages one you mentioned?

The site-packages should be all you need.

Things got changed up a bit for v8. The site-packages folder more of a python standard.

1 Like