Installation¶
snps is available on the
Python Package Index. Install snps (and its required
Python dependencies) via pip:
$ pip install snps
Installation and Usage on a Raspberry Pi¶
The instructions below provide the steps to install snps on a
Raspberry Pi (tested with
“Raspberry Pi OS (32-bit) Lite”,
release date 2020-08-20). For more details about Python on the Raspberry Pi, see
here.
Note: Text after a prompt (e.g.,
$) is the command to type at the command line. The instructions assume a fresh install of Raspberry Pi OS and that after logging in as thepiuser, the current working directory is/home/pi.
Install
pipfor Python 3:pi@raspberrypi:~ $ sudo apt install python3-pip
Press “y” followed by “enter” to continue. This enables us to install packages from the Python Package Index.
Install the
venvmodule:pi@raspberrypi:~ $ sudo apt install python3-venv
Press “y” followed by “enter” to continue. This enables us to create a virtual environment to isolate the
snpsinstallation from other system Python packages.-
pi@raspberrypi:~ $ sudo apt install libatlas-base-dev
Press “y” followed by “enter” to continue. This is required for NumPy, a dependency of
snps. Create a directory for
snpsand change working directory:pi@raspberrypi:~ $ mkdir snps pi@raspberrypi:~ $ cd snps
Create a virtual environment for
snps:pi@raspberrypi:~/snps $ python3 -m venv .venv
The virtual environment is located at
/home/pi/snps/.venv.Activate the virtual environment:
pi@raspberrypi:~/snps $ source .venv/bin/activate
Now when you invoke Python or
pip, the virtual environment’s version will be used (as indicated by the(.venv)before the prompt). This can be verified as follows:(.venv) pi@raspberrypi:~/snps $ which python /home/pi/snps/.venv/bin/python
Install
snps:(.venv) pi@raspberrypi:~/snps $ pip install snps
Start Python:
(.venv) pi@raspberrypi:~/snps $ python Python 3.7.3 (default, Jul 25 2020, 13:03:44) [GCC 8.3.0] on linux Type "help", "copyright", "credits" or "license" for more information. >>>
Use
snps; examples shown in the README should now work.At completion of usage, the virtual environment can be deactivated:
(.venv) pi@raspberrypi:~/snps $ deactivate pi@raspberrypi:~/snps $