To ensure optimal performance and access to the latest features, it's important to regularly update your Python environment, including the Text-Fabric package. This Jupyter Notebook offers step-by-step instructions to check the current version of Text-Fabric and update it to the latest release or a specific version, as needed.
The format of these commands can be used in any cell within a Jupyter Notebook. When running the commands in a shell, you can omit the trailing exclamation mark (!).
The following activities are described in this section of the Notebook:
An overview of the available Text-Fabric version can be obtained from the page with recent Text-Fabric release notes.
The following will list the text-fabric package along with its version:
# Check the current version of Text-Fabric
!pip show text-fabric
When executing this in a Jupyter Notebook cell it will output something like:
Name: text-fabric Version: 12.5.3 Summary: Processor and browser for annotated text corpora Home-page: https://github.com/annotation/text-fabric Author: Dirk Roorda Author-email: dirk.roorda@di.huc.knaw.nl License: Location: C:\Users\tonyj\anaconda3\envs\Text-Fabric\Lib\site-packages Requires: flask, ipython, markdown, pyyaml, requests, wheel Required-by:
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.
To upgrade to the latest release of Text-Fabric the following command can be used:
# Update Text-Fabric to the latest version
!pip install --upgrade text-fabric
When executing this in a Jupyter Notebook cell the following output is shown (which is abbreviated here):
Requirement already satisfied: text-fabric in c:\users\tonyj\anaconda3\envs\text-fabric\lib\site-packages (12.5.1) Collecting text-fabric Using cached text_fabric-12.5.3-py3-none-any.whl.metadata (1.9 kB) Requirement already satisfied: wheel in c:\users\tonyj\anaconda3\envs\text-fabric\lib\site-packages (from text-fabric) (0.41.2) ... Requirement already satisfied: six in c:\users\tonyj\anaconda3\envs\text-fabric\lib\site-packages (from asttokens->stack-data->ipython->text-fabric) (1.16.0) Using cached text_fabric-12.5.3-py3-none-any.whl (12.3 MB) Installing collected packages: text-fabric Attempting uninstall: text-fabric Found existing installation: text-fabric 12.5.1 Uninstalling text-fabric-12.5.1: Successfully uninstalled text-fabric-12.5.1 Successfully installed text-fabric-12.5.3
In certain cases, it may be necessary to load a specific version of Text-Fabric. For example, if the analysis described in a publication uses a specific Text-Fabric version, you might need to use the same version to reproduce the results. This typically involves downgrading to an earlier version.
Downgrading to an earlier Text-Fabric version can be done using the following command:
!pip install text-fabric==<desired_version>
Where <desired_version> is the unqouted version number. For example to downgrade to version 12.5.1 the following command can be used:
# Update Text-Fabric to version 12.5.1
!pip install text-fabric==12.5.1
As example, when downgrading from version 12.5.3, the following output is shown (which is abbreviated here):
Collecting text-fabric==12.5.1 Downloading text_fabric-12.5.1-py3-none-any.whl.metadata (1.9 kB) Requirement already satisfied: wheel in c:\users\tonyj\anaconda3\envs\text-fabric\lib\site-packages (from text-fabric==12.5.1) (0.41.2) ... Requirement already satisfied: six in c:\users\tonyj\anaconda3\envs\text-fabric\lib\site-packages (from asttokens->stack-data->ipython->text-fabric==12.5.1) (1.16.0) Downloading text_fabric-12.5.1-py3-none-any.whl (12.3 MB) ---------------------------------------- 0.0/12.3 MB ? eta -:--:-- ... ---------------------------------------- 12.3/12.3 MB 4.3 MB/s eta 0:00:00 Installing collected packages: text-fabric Attempting uninstall: text-fabric Found existing installation: text-fabric 12.5.3 Uninstalling text-fabric-12.5.3: Successfully uninstalled text-fabric-12.5.3 Successfully installed text-fabric-12.5.1