05-09-2018 04:20 PM
I would like to install some additional Python modules for use in NetMRI scripts. It doesn't look like pip is installed in the sandbox by default. What is the best way to install new modules to have them work from scripts and not interfere with any system processes? Thanks for any info.
06-06-2018 08:55 AM
SSH into the NetMRI appliance type in “sandbox login”
Then run the following
I used the following get-pip.py script to install it and then we were able to install other modules via “pip install”
So now in the UI Python scripts you can use the new installed module.
NOTE: I have not tested if the “sandbox” gets upgraded, if it resets these modules or not.
[root@sandbox ~]# wget https://bootstrap.pypa.io/get-pip.py
--2017-12-21 08:14:20-- https://bootstrap.pypa.io/get-pip.py
Resolving bootstrap.pypa.io... 188.8.131.52
Connecting to bootstrap.pypa.io|184.108.40.206|:443... connected.
HTTP request sent, awaiting response... 200 OK
Length: 1595408 (1.5M) [text/x-python]
Saving to: `get-pip.py'
100%[===========================================================================================>] 1,595,408 212K/s in 11s
2017-12-21 08:14:32 (145 KB/s) - `get-pip.py' saved [1595408/1595408]
[root@sandbox ~]# python3 get-pip.py
Downloading pip-9.0.1-py2.py3-none-any.whl (1.3MB)
100% |████████████████████████████████| 1.3MB 105kB/s
Downloading wheel-0.30.0-py2.py3-none-any.whl (49kB)
100% |████████████████████████████████| 51kB 113kB/s
Installing collected packages: pip, wheel
Successfully installed pip-9.0.1 wheel-0.30.0
[root@sandbox ~]# pip install whateveryou want
06-06-2018 10:45 PM - edited 06-06-2018 10:47 PM
If there is no internet connection on the sandbox you can use the following workaround to upload script or modules to sandbox:
Upload the script or module to the sandbox environment by using SCP to send the file into the administrator shell's /Backup/Sandbox directory (below is an example):
scp get-pip.py firstname.lastname@example.org:/Backup/Sandbox
In the administrative shell, the /Backup/Sandbox directory maps to the /mnt/host/data/userdata directory inside the sandbox. After the file has been successfully uploaded to the sandbox, login to the sandbox via the administrative shell.
Once inside the sandbox, use the standard installation procedure to install script or modules located at
/mnt/host/data/userdata. As an example:
#pip install package_name
The above information will also be added to Admin Guide in Future Releases of NetMRI