I know that outside libraries should be installed in the user-lib\pylib folder of Ignition. However, the one I want to use, python-docx, for making/editing word documents, only seems to have pip-install options, or a .tar.gz file to manually download.
I feel like I almost got it. Through some manual downloads and extractions, I got the docx folder that I need. However when I try to run the sample code from the documentation, from docx import Document I get
Traceback (most recent call last):
File "<input>", line 1, in <module>
File "C:\Users\bkarabinchak\.ignition\cache\gwlocalhost_8088\C0\pylib\docx\__init__.py", line 3, in <module>
from docx.api import Document # noqa
File "C:\Users\bkarabinchak\.ignition\cache\gwlocalhost_8088\C0\pylib\docx\api.py", line 14, in <module>
from docx.package import Package
File "C:\Users\bkarabinchak\.ignition\cache\gwlocalhost_8088\C0\pylib\docx\package.py", line 9, in <module>
from docx.opc.package import OpcPackage
File "C:\Users\bkarabinchak\.ignition\cache\gwlocalhost_8088\C0\pylib\docx\opc\package.py", line 9, in <module>
from docx.opc.part import PartFactory
File "C:\Users\bkarabinchak\.ignition\cache\gwlocalhost_8088\C0\pylib\docx\opc\part.py", line 12, in <module>
from .oxml import serialize_part_xml
File "C:\Users\bkarabinchak\.ignition\cache\gwlocalhost_8088\C0\pylib\docx\opc\oxml.py", line 12, in <module>
from lxml import etree
ImportError: cannot import name etree
I believe I have the correct lxml folder as well, but I’ve tried placing it in a few different locations, in pylib as well as inside docx to no avail. If someone could help me figure out where to put the lxml folder I things will work.
To replicate what I have, extract the docx folder and put it so its path is C:\Program Files\Inductive Automation\Ignition\user-lib\pylib\docx. What I am trying to figure out is where to put the lxml folder, or perhaps change the import statements in the docx as a last resort if need be.