I am trying to replicate a similar result to the Python output, in which two Excel files are used to generate the desired output by highlighting missing data in the input Excel file. The first Excel file is to be matched using regular expressions against the second Excel file (in which two sheets will be used for comparison with the first Excel sheet). Please suggest how I should proceed. I have attached python code for the reference as (kindly change extension from .txt to .py) .
Solved! Go to Solution.
You are getting an error on the packages. Have you installed os and openpyxl? I'm not sure if re is installed by default either, but I can't see an error for that one. The script is trying to import them, but if they are not installed, then there is nothing to call.
I have installed it but in Alteryx its giving error, I have installed manually also openpyxl in its source path location.
Have you installed it on the Alteryx Python install, or another Python version on your machine?
In a new python tool on a canvas, check the list of packages installed, and if it is not there, then install.Packages([.....
The error being thrown above is because the modules can't be found. This is most commonly because the Packages aren't installed.
How can i install openpyxl in Alteryx , I have installed it before installing Alteryx in Python.
"Error: Python (6): ---------------------------------------------------------------------------
ModuleNotFoundError Traceback (most recent call last)
Cell In[1], line 4
2 import pandas as pd
3 import os
----> 4 from openpyxl import load_workbook
6 # Load incoming data from Alteryx
7 df = Alteryx.read("#1") # Assuming stream #1 contains joined & validated data
ModuleNotFoundError: No module named 'openpyxl' "
If you installed it before installing Alteryx, then it will not be on the Alteryx Python install.
You generally need elevated permissions to install new packages, which is good, because it means that you can't just run a script installing 5 random packages with unintended consequences. If you can't do it in the Python tool (Alteryx running as admin if possible) with Package.installPackages(['openpyxl']) then you will need to use pip.
Thank for the input, I reinstalled Python in admin mode and it resolved the issue.