1.1. SteelScript Installation - Linux / Mac¶
This page provides step-by-step instructions for installing SteelScript and associated modules in the system-wide site-packages directory on a Linux or Mac. This will make SteelScript available to all users.
1.1.1. Dependencies¶
- Python version 2.7.x - see python.org
- Python setuptools
You must already have Python and the setuptools package installed on your system to continue. If not, please install Python from python.org or ask your system administrator to install it for you.
You can check that Python is installed and running the appropriate version:
$ python -V
Python 2.7.3
1.1.2. Online Installation - Virtualenv¶
This is the recommended approach when your target system has access to the internet. If access is limited, see below for Offline Installation via pip instructions.
These steps will install steelscript inside an isolated python environment
called a virtualenv
. The great thing about virtualenv’s are how they can
allow you to experiment and upgrade packages without worrying about overwriting
any system requirements, and you can create as many as you’d like in order to
separate different projects from one another.
Install Virtualenv using one of the following methods:
$ sudo easy_install virtualenv
On a Ubuntu or Debian flavor of Linux, you can use your package manager:
$ sudo apt-get install python-virtualenv
For Red Hat or CentOS flavors:
$ sudo yum install python-virtualenv
Now create a fresh virtualenv to install the packages into. Let’s create a working folder to hold all of your steelscript projects inside too, we will create this folder in your home directory:
$ cd ~ $ mkdir steelscript $ cd steelscript $ virtualenv venv New python executable in venv/bin/python Installing setuptools, pip...done.
Whenever you want to work on a steelscript project, you will need to run the following command to activate this virtualenv in your shell session:
$ . ~/steelscript/venv/bin/activate (venv)$
Note
Note how your prompt changes to include the name of the virtual environment. You can also confirm you are working within the new environment by checking which python executable is in your path:
(venv)$ which python ~/steelscript/venv/bin/python
Since virtualenv comes with a built-in pip installer, we can easily install the base steelscript package
steelscript
:(venv)$ pip install steelscript
This package provides the common functions used by all other SteelScript product specific modules. Additional Python dependencies such as Python requests will also be installed too.
Included in this package was a new script called steel which can install the rest of our core packages:
$ steel install Checking if pip is installed...done Package steelscript already installed Installing steelscript.netprofiler...done Installing steelscript.netshark...done Installing steelscript.wireshark...done
See http://github.com/riverbed for a complete list of additional SteelScript packages available.
Verify your installation by running a simple test:
$ steel about Installed SteelScript Packages Core packages: steelscript 1.0 steelscript.netprofiler 1.0 steelscript.netshark 1.0 steelscript.wireshark 1.0 Application Framework packages: None REST tools and libraries: None Paths to source: ~/steelscript/venv/lib/python2.7/site-packages (add -v or --verbose for further information)
Make a workspace to copy over the included example scripts and create a sandbox to work around with:
$ steel mkworkspace
Take a look at your new files and start developing!
1.1.3. Offline Installation via pip¶
Use this method to install SteelScript when the target system:
- does not have direct access to the internet
- does have the
pip
command available
The pip
package tool has a helpful utility to download packages
and their dependencies instead of directly installing them.
Make an archive directory:
$ mkdir steelscript_packages
Create a local archive of the core steelscript package and its dependencies:
$ pip install -d steelscript_packages steelscript
Inside the folder
steelscript_packages
you should see archives forsteelscript
,requests
, andimportlib
.Add any additional steelscript packages of interest. The following will download the netprofiler, netshark, and wireshark packages to the same archive directory along with
virtualenv
:$ pip install --no-use-wheel -d steelscript_packages steelscript.netprofiler $ pip install --no-use-wheel -d steelscript_packages steelscript.netshark $ pip install --no-use-wheel -d steelscript_packages steelscript.wireshark $ pip install --no-use-wheel -d steelscript_packages virtualenv
Note
The
--no-use-wheel
option makes sure the packages can be installed on a barebones system that may not havepip
available.Add any other packages of interest you may need using the same approach above with a
pip install
and the-d
option.Tar up the packages directory:
$ tar cvzf steelscript_packages.tar.gz steelscript_packages
Transfer it to your target system using whatever approach you choose (scp, usb key, share drive, floppy ...).
(Optional) Depending on your system requirements, you can create a virtualenv in this system as well and install the packages into that, as described above. Start off by getting the package installed onto the system:
$ sudo pip install --no-index -f steelscript_packages virtualenv
If
pip
is not available on the target system, then install the package manually:$ pip install steelscript_packages/virtualenv*
From here you can setup a working directory, create your virtualenv, and activate it for the remaining steps (just omit
sudo
from the rest of the commands!)Use
pip
to install the base steelscript package, telling it to usesteelscript_packages
as the place to find relevant files:$ sudo pip install --no-index -f steelscript_packages steelscript
Repeat that command replacing the last
steelscript
name with the name of any extra packages you want included. Don’t worry about steelscript packages, those can be installed with the following:$ sudo steel install --pip-options="--no-index -f pkgs"
Note
Omit
sudo
if you are using virtualenv, as admin privileges are not requiredVerify your installation with
steel about
1.1.4. Manual Installation without pip¶
Use this method to install SteelScript when the target system:
- does not have direct access to the internet
- does not have the
pip
command available
Follow the instructions from Offline Installation via pip, to create the archive directory and transfer it over to the system. Creating a virtualenv is still optional, but recommended.
In case you would prefer to install system wide, then extract the steelscript_packages.tar.gz file, and manually install each package one by one:
$ tar xvzf steelscript_packages.tar.gz
$ cd steelscript_packages
Repeat the following steps for each the following packages, in order:
- importlib
- requests
- steelscript
- steelscript.netprofiler
- steelscript.netshark
- steelscript.wireshark
Replace <packagename>
below with the filename from the tarball:
$ tar xvzf <packagename>.tar.gz
$ cd <packagename>
$ python setup.py install
Verify your installation with steel about
1.1.5. Upgrading SteelScript¶
If you’d like to upgrade SteelScript package to a newer released version, and you are offline, simply repeat the above installation steps. This will install the latest version alongside the older version. Normally you do not need to delete the older version.
In other cases, you can simply use the built in steel to update the packages for you:
$ steel install --upgrade
This will check for a more recent version of all the installed SteelScript packages and install newer versions if available.