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 ./
            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.

          • 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. Start the setup and ...
          • 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 ...
          • Commands used to fetch Hardware and Software Details from Linux,Solaris,AIX,MAC and HP-UX device scans.

            Attached are the consolidated commands for respective devices.
          • How to run ServiceDesk from command prompt?

            Open a command prompt window in the elevated mode (run as administrator) and change directory to             cmd> [SDP-Home]\bin [SDP-Home] here, is assumed to be ServiceDesk home directory (\ManageEngine\Servicedesk\bin) Start the server from the ...
          • 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 ...