Python Troubleshooting steps

Python Troubleshooting steps

Here we are listing the troubleshooting steps for the python script to be executed

1. Check whether python is installed or not in the sever where SDP is installed
2. If it's installed check the version of python ( Preferable version should be above 3.7)
3. Check whether python path is added in an environment variables


4. Check whether Execute script is added correctly or not in Custom Menu/Custom Trigger

Example: py createChildRequests.py (if python path is set in an environment variable)
C:\Users\seshadri-0040\AppData\Local\Programs\Python\Python37-32\python.exe createChildRequests.py  (if python path is not set in an environment variable)

5. if ImportError: No module named requests error occurs when executing a file we need to import the requests module



Note: If any module error comes we need to install the same module

6. If module error comes even after installing the module, Check if any multiple python versions installed in the server 
‚Äč
If multiple python versions installed uninstall any one version and follow the same steps from starting

                    New to ADSelfService Plus?

                      • Related Articles

                      • Create New request using Python Script

                        Script to raise a new request using Python Script. Pre-requisite - Python should be installed in the server and configured. You can review the instructions here - Requests module should be installed with the python Steps 1. Download the zip file from ...
                      • How to setup Python on the Server

                        This article explains how to set up the ServiceDesk Plus MSP server to run python scripts. 1. The first step is to install python on the application server and you can download it from here. Any version above 3.4.1 should work fine. Start the setup ...
                      • Some errors related to Python when trying to run a script in SDP MSP

                        Case 1: We could see cases where users come across the below error when trying to execute scripts. This happens if the requests library is not imported.   In order to import the requests library in Python, follow the steps below: 1. Open cmd as admin ...
                      • Request add attachment_Python script-API

                        Steps for adding attachment to the request through python script-API. Extract the attached  "Attachment_Python_Script.zip" >> Edit attachmentscript.py >>Mention product installed url in the base url ; update the api key; update the request id that ...
                      • Cannot run program "python" or Can't find a default python

                        Use case While trying to run a python script, this error can be found. It usually occurs when the python is not installed/set up properly. Solution Try specifying the complete path of the python.exe instead of py and then in the argument specify the ...