Collecting Environmental Variables Relating to Python in Linux/Windows/MacOSX

Collecting Environmental Variables Relating to Python in Linux/Windows/MacOSX

When setting up a python script in the customer's end, a major challenge is relating to the following:
  1. Is Python installed or not?
  2. If installed, are the required modules installed or not?
Answering the above will help us in overcoming the doubt of whether the issue is script related or python related.
Also, the attached script itself will install the required modules if PIP is present in the customer's end.

In short, the .sh and .bat files must be run sudo or administrator in Windows:
      sudo ./pyenvdetails.sh
            or pyenvdetails.bat (as admin from windows)

It will run python related commands to search modules, install them and also collect a list of all environmental variables from the environment and dump it into one folder:

      - and similarly in Windows.

Linux script will auto compress and provide a .zip file,
      whereas Window's doesn't support command line compression without third-party apps. Therefore the end user must compress on WinOS.

Once the files are shared, the set.txt (win) and env.txt (linux) will list all the environmental variables,
      and the output of python calls will tell us if python is installed.

If a text output is empty, it means that the respective command didn't fetch any info from the environment.

Please attempt on your end to test the same and revert back to me for any clarifications or criticism.



                  New to ADManager Plus?

                    New to ADSelfService Plus?

                      • Related Articles

                      • How to setup Python on the Server

                        This article explains how to set up the ServiceDesk plus 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. Once you've ...
                      • Bulk Request Delete via python script invoked from command prompt

                        Please refer to the below link to install and configure python on the server. https://pitstop.manageengine.com/portal/kb/articles/how-to-setup-python-on-the-server/ Steps for configuring the script: Extract the zip in a particular location, eg:  ...
                      • Bulk request edit via python script invoked from command prompt

                        Please refer to the below link to install and configure python on the server. https://pitstop.manageengine.com/portal/kb/articles/how-to-setup-python-on-the-server/ Steps for configuring the script: Extract the zip in a particular location, eg: ...
                      • Cert Generation for Windows and Linux OS

                        For Windows: 1. Download the attached 'wincertgeneration' zip file and extract it in ..\ManageEngine\Servicedesk directory. After extraction, you should find the below files.,     gencert.bat under  ..\ManageEngine\Servicedesk     Cert.jar should be ...
                      • How to Use nslookup command?

                        NSlookup is a command-line tool used for testing and troubleshooting DNS servers. It is one of most powerful and frequently used tools used by Systems and Network Engineers / Administrators. This document will help you use the basic of nslookup ...