Getting started with ActivePython on Solaris

  • Install Location: /opt/ASpy36 by default, but can be specified at install time
  • Local Documentation: Open /opt/ASpy36/doc/python3.6/index.html in your browser.

Running Python and the Interactive Shell

The ActivePython installer on Solaris installs to /opt/ASpy36 by default, but an alternate install directory (for example, somewhere in your home directory) can be specified at install time. To be able to simply run python from the shell you either need to add this install directory’s bin dir to your PATH:

If you use the Bash shell place the following in your ~/.bashrc file.

PATH=/opt/ASpy36/bin:$PATH; export PATH

If you use the tcsh shell place the following in your ~/.cshrc file.

setenv PATH /opt/ASpy36/bin:$PATH

Alternatively, you can create symlinks from some directory already on your PATH (commonly /usr/local/bin) to python:

sudo ln -sf /opt/ASpy36/bin/python3.6 /usr/local/bin/python3.6
sudo ln -sf /usr/local/bin/python3.6 /usr/local/bin/python

Type python in the shell. (If you modified your shell startup script, you may need to start a new shell to see the PATH changes.) You should see something like the following:

ActivePython 3.6.0.3600 (ActiveState Software Inc.) based on
Python 3.6.0 (default, Mar 21 2017, 09:33:37) [C] on sunos5
Type "help", "copyright", "credits" or "license" for more information.
>>>

You can use the Python shell to interactively run Python code. This can be very useful development and debugging tool. Learn how to use Python’s built-in dir() and help() introspection functions to dive into Python objects. For example, try running the following:

>>> import os.path
>>> dir(os.path)
list of members of os.path module...
>>> help(os.path)
MAN page-like description of the os.path module...
>>> help(os.path.join)
help on the join function...

Read the Python Tutorial for more information.