Error on openpyxl in Python script

Posted on
Sun Oct 20, 2019 12:51 pm
Pavasc offline
Posts: 1
Joined: Dec 06, 2017

Error on openpyxl in Python script

Schermafbeelding 2019-10-20 om 20.40.44.png
Error in log (filename " Test 3.py")
Schermafbeelding 2019-10-20 om 20.40.44.png (17.83 KiB) Viewed 621 times
I'm busy converting my latest Applescript scripts to Python scripts. These scripts are used to write data from Indigo variables to an Excel file. I was still testing in Python 3.8 and it worked great with openpyxl. I created a trigger in Indigo which executes a Python file (Server Actions). When I run the script it comes up with an error: "No module named openpyxl".

Is there a (simple) solution, explanation for this error?

Below the content of the Python file:

from openpyxl import load_workbook

wb = load_workbook("Data energie.xlsx")

rDroger = indigo.variables[1465340070]
rWasmachine = indigo.variables[209372696]

import datetime
now = datetime.datetime.now()

# grab the active worksheet
ws = wb.active

ws['A2'] = now
ws['B2'] = rDroger
ws['C2'] = rWasmachine

ws.insert_rows(2, 1)

# Save file
wb.save("Data energie.xlsx")

Posted on
Sun Oct 20, 2019 1:19 pm
FlyingDiver offline
User avatar
Posts: 7215
Joined: Jun 07, 2014
Location: Southwest Florida, USA

Re: Error on openpyxl in Python script

Indigo scripts are Python 2.7, not 3.X.

You need to install that module for Python 2.7. Try:

Code: Select all
sudo pip2 install openpyxl

joe (aka FlyingDiver)
my plugins: http://forums.indigodomo.com/viewforum.php?f=177

Page 1 of 1

Who is online

Users browsing this forum: No registered users and 5 guests