Before you can use Text-Fabric, you need to install it in your environment. The instructions in this section need to be executed only once. After installation, the Text-Fabric package will be available for loading into your system's memory.
Since Text-Fabric is a Python package, it requires Python to be installed on your system. Make sure you have at least Python 3.7.0. If you do not have Python installed yet, you can use a package manager like Anaconda, which provides a Jupyter Notebook environment along with the Python setup. For more details you can refer to this Jupyter Notebook for installation instructions.
Another source of information on installing Text-Fabric can be found at this Text-Fabric GitHub page.
Installing the Text-Fabric package in a Python environment uses pip, the Python package installer. To install Text-Fabric, you can use the following command in a Python shell:
pip install text-fabric
If you are issuing this command in any cell inside Jupyter Notebook, you need to add an exclamation mark in front to signal that the command should be executed in the shell:
!pip install text-fabric
Note that in the Notebook viewer the exclamation mark is enclosed in a red box which helps users to see that this line is a shell command and not standard Python code.
The previous commands install the basic Text-Fabric package. However, Text-Fabric does also prrovide a number of options during installation. If you wish to load the add-on features or use specific dataset versions other than the latest release, you will need to download individual files directly from the GitHub repository. This requires having Text-Fabric installed with support for this functionality. You can install this feature either during the initial installation of Text-Fabric or later as an upgrade by running the following command in your Python environment:
pip install text-fabric[github]
If you are issuing this command in any cell inside Jupyter Notebook, you need to add an exclamation mark in front to signal that the command should be executed in the shell:
!pip install text-fabric[github]
Note that if using the pip
command gives an error, you can try using pip3 instead. This issue may arise because both Python 2 and Python 3 are installed on your system, and pip may be associated with Python 2. In such cases, the package manager for Python 3 is often installed as pip3
.
See also: