I'm trying to run some Python code in Microsoft Power Automate Desktop. I'm aware that PAD will only run Python version 2.7 or earlier. I have tested the code in the command line and it appears to work using Python 2.7. Typing 'py -2.7 CodeName.py' in the command line appears to run the code successfully, but putting that same code into the 'Run Python Script' action in PAD yields the following ScriptError:
''' Traceback (most recent call last): File "", line 2, in File "C:\Python27\Lib\site- packages\jwt_init_.py", line 19, in File "C:\Python27\Lib\site-packages\jwt\api_jwt.py", line 1, in ImportError: No module named json '''
api_jwt.py line 1 is simply 'Import json', which should be included in Python 2.7. My attempts to add json to my Python 2.7 install:
Typing: ''' C:\py -2.7 -m pip install json ''' In the command line yields the following error:
ERROR: Could not find a version that satisfies the requirement json (from versions: none) ERROR: No matching distribution found for json
And searching similar questions on stack overflow the answers all indicate json should already be installed.
Is it possible to add json to Python 2.7 manually, or verify that it's been added, or otherwise fix the issue within Power Automate Desktop?