Installing ActivePython for Linux

Installing ActivePython using the State Tool (beta)

The State Tool is the command line interface (CLI) for the ActiveState Platform. You can use it to authenticate with the Platform, and then download and configure your ActivePython 3.7 runtime environment.

  1. If you don’t already have the State Tool installed, open your command prompt and run the following command to set it up:

    sh <(curl -q https://platform.activestate.com/dl/cli/install.sh)
    

    You can specify the directory to install the State Tool into using the -t flag.

    sh <(curl -q https://platform.activestate.com/dl/cli/install.sh) -t ~/bin
    

    Follow the prompts in the command prompt and then open a new command prompt or source your .profile file to complete the installation and configuration.

  2. Run state activate ActiveState/ActivePython-3.7. This command downloads the runtime environment from the ActiveState Platform, configures it, and creates an “activated state”, an isolated environment for you to work in.

Installing ActivePython using the tarball installer

You can install ActivePython by downloading the release tarball, the installer archive file with a tar.gz extension, extracting the files, and running the installation script.

To download and install ActivePython:

  1. Navigate to the ActivePython 3.7.4 project page on the ActiveState Platform: https://platform.activestate.com/ActiveState/ActivePython-3.7
  2. Click the Download Builds tab.



    You must sign in to the Platform to download builds. Enter your username and password, click Sign in with Github to us your GitHub credentials, or click Create an Account to set up a new free account.

  3. Click the Download .tar.gz button.

  4. Open a command prompt on your computer and navigate to the download directory.

  5. Extract the installation files from the tarball: tar xzf ActivePython-<build_information>.tar.gz.

    Note: the filename will be similar to the following: ActivePython-3.7.4.0000-linux-x86_64-glibc-2.17-07ca90fa.tar.gz. It is made up of the Python version number, the Activestate version number, platform information, and a unique identifier.

    Tip You can enter the first few characters of the filename and press tab instead of typing out the whole filename.

  6. Navigate to the extracted director, which is the downloaded filename minus tar.gz. For example: cd ActivePython-3.7.4.0000-linux-x86_64-glibc-2.17-07ca90fa

    You can enter the first few characters and press tab instead of typing out the whole filename.

  7. Enter ./install.sh to run the installation script.

    Note: You must have write access to the directory you are installing ActivePython into. In particular, if you want to the default installation location (/obt/ActivePython-3.7) you must run the installer with a user that has write privileges to this folder. One option is to use sudo to run the installer: sudo ./install.sh.

  8. The installer prompts you to choose to rewrite sehbang lines of scripts to use /usr/bin/env. This is important if you need your installation to be relocatable, but otherwise you can accept the default option N

  9. Optional. If you installed ActivePython in a directory that is not already on your PATH, you can add the bin directory to your PATH environment variable for quicker access. For example, if you installed ActivePython in ~/AP37 you need to update your .bashrc configuration file (or equivalent depending on the shell you are using) with the new path. For example:

    export PATH=~/AP37/bin:~/AP37/Tools:~/AP37/ninja:$PATH
    
  10. If you are running a Linux distribution other than CentOS, you need to set your system’s OPENSSLDIR environment variable to you system’s default OPENSSL certificate directory. For example, add export OPENSSLDIR=/usr/lib/ssl to your .bashrc (or equivalent) configuration file.

Example:

Installing in the default folder without rewriting scripts.

$ tar -xzf ActivePython-3.7.4.0000-linux-x86_64-glibc-2.17-07ca90fa.tar.gz 
$ cd ActivePython-3.7.4.0000-linux-x86_64-glibc-2.17-07ca90fa/
$ sudo ./install.sh
Enter directory in which to install ActivePython. Leave blank and
press 'Enter' to use the default [/opt/ActivePython-3.7].
Install directory: 
Do you want to rewrite the shebang lines of scripts to use /usr/bin/env? [y/N] 

Installing ActivePython to '/opt/ActivePython-3.7'...
Relocating dir-dependent files...

Non-interactive install

By default the install script will prompt you for an install directory. You can avoid this interaction by specifying the install directory with the -I <installdir> option. Enter ./install.sh -h option for full usage information.

Example:

$ tar -xzf ActivePython-3.7.4.0000-linux-x86_64-glibc-2.17-07ca90fa.tar.gz 
$ cd ActivePython-3.7.4.0000-linux-x86_64-glibc-2.17-07ca90fa/
$ ./install.sh -I ~/APY37

Uninstalling ActivePython

Remove the directory where you installed ActivePython. If you configured the PATH environment variable during installation, update your configuration files to no longer reference the ActivePython configuration directories.