Video Of Day

Breaking News

Installation Instructions For The Python Sfc_Models Package

The next text is an excerpt from An Introduction to SFC Models Using Python (Section 2.2). Although I apparently desire to sell copies of my book, I desire users to travel able to piece of occupation the bundle get-go for free. For an experienced Python programmer, the installation is real easy, as sfc_models is a vanilla Python package. However, many of my readers volition non travel familiar amongst Python, together with would demand unopen to guidance inwards gild to gear upwards it up.

I added inwards a file that describes the installation (at a high level) inwards the package, which users volition hopefully meet if they await at the GitHub repository. At unopen to point, I would similar to construct upwards a gratuitous PDF that describes how to install together with run examples. (Helping amongst documentation is i of the nigh pressing needs for exterior help.)


Python is an opened upwards source programming language, together with hence it tin travel downloaded at no cost. The user is gratuitous to create what they wishing amongst the software, hence long equally they follow the damage of the licence agreement. (The sfc_models bundle is likewise distributed inwards this fashion.)

I volition non offering instructions on how to install Python; the procedures depend upon the computer’s operating system. There is a keen bargain of troubleshooting information available on the internet.

The primal determination is whether you lot wishing to download the base of operations Python installation or piece of occupation amongst an integrated evolution surroundings (IDE). I used to create my Python programming amongst the IDLE GUI (Graphical User Interface) that is installed past times default amongst Python, but I accept switched to using the PyCharm™ evolution surroundings past times JetBrains: (https://www.jetbrains.com/pycharm/). PyCharm is available inwards 2 principal editions: a gratuitous community edition that is sufficient for nigh programming together with a commercial edition that is aimed at professional person software developers. In addition, JetBrains has an edition for learning how to program: the user goes through lessons inwards steps. (There are other programming platforms available for Python; I am non familiar amongst them.)
Once you lot accept installed Python, at that spot are 3 ways of using the language.
  1. You tin start the Python interpreter, together with and hence type commands that are together with hence processed. This interactive fashion is useful for testing, but it is non the preferred means to create complex tasks. This interactive fashion is similar to how Matlab together with R are used, but non compiled languages (like C++).
  2. You tin accept the Python interpreter start running a script, together with and hence it processes the commands inside the script (Python scripts are files amongst the extension “.py”).
  3. You tin piece of occupation amongst a graphical evolution surroundings (IDLE, PyCharm) together with railroad train Python scripts. You together with hence launch the scripts using a command inside the GUI. This is the commons means of developing inwards Python.
The wages of working amongst Python scripts (*.py files) is that you lot tin repeat the same steps without having to type them inwards again.

Once Python is installed, at that spot are 2 ways of installing the sfc_models package: either downloading the latest Python bundle or past times using the git source command system.

The easiest method is to charge the latest production version that has been uploaded to the Python Package Repository (at pypi.org). The bundle is institute at: https://pypi.python.org/pypi/sfc_models/. This download tin either travel done automatically through PyCharm, or else using the pip installation script on the command line.

The piece of occupation of PyCharm is the simplest solution; you lot only demand to add together the sfc_models bundle to the Python installation, equally described inwards the PyCharm documentation.

The slightly to a greater extent than complex solution is to piece of occupation the pip installation script. The script is institute inwards the “scripts” subdirectory below the Python installation. From the command line, you lot only demand to run:

pip install sfc_models

However, you lot may demand to create unopen to steps earlier running “pip install,” together with those steps may vary across operating systems. Since these installation methods volition alter over time, the reader is referred to online documentation on the usage of pip.

Code examples are institute inwards the sfc_models/examples/scripts directory. You could notice this directory, together with re-create the files to a working directory. Alternatively, you lot tin run an installation script that is available i time sfc_models is installed. To create this, opened upwards a Python console, together with run the following.

from sfc_models.objects import *
install_examples()

Invoking install_examples should convey upwards pop-up windows that inquire you lot where you lot wishing to install the instance scripts.

Using source command is discussed inwards Section 2.6.

(c) Brian Romanchuk 2017-2018

No comments