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 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 ...
                    • 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 ...
                    • 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 ...
                    • Linux console commands

                      Linux console commands *. To Install from console mode : - Download bin - Execute the command to make the bin executable - chmod 755 ManageEngine_ServiceDeskPlus_MSP_64bit.bin ( Color of the bin will get changed to green I.e Executable mode ) - ...
                    • 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: ...