There are different ways to install Taipy, depending on how you plan to use it.
If your goal is to look into the code, modify and improve it, go straight to the source installation section.
Taipy needs your system to have Python 3.9 or above installed.
The easiest way to install Taipy is from the Pypi software repository.
Run the command:
pip install taipy
If you are running in a virtual environment, you will have to issue the command:
pipenv install taipy
Alternatively, you can use venv
to create a virtual environment:
python -m venv myenv
source myenv/bin/activate # On Windows use `myenv\Scripts\activate`
pip install taipy
These commands install the taipy
package in the Python environment with all its
dependencies.
To install a specific version of Taipy, use the following command:
pip install taipy==<version>
Replace <version>
with a specific version number of Taipy.
The list of all released Taipy versions can be found here.
The development version of Taipy is updated daily with changes from the Taipy R&D and external contributors whom we praise for their input.
The development version of Taipy can be installed using pip and git:
pip install git+https://[email protected]/Avaiga/taipy
If you need the source code for Taipy on your system so you can see how things are done or maybe participate in the improvement of the packages, you can clone the GitHub repository:
git clone https://github.com/Avaiga/taipy.git
This creates the 'taipy' directory holding all the package's source code.
Taipy (and Taipy GUI that it embeds) has some code dealing with the client side of the web
applications.
This code is written in TypeScript, relies on
React components, and is packaged into JavaScript bundles that are sent to
browsers when they connect to all Taipy applications that have a graphical interface.
There are two main JavaScript bundles that can be built:
- Taipy GUI: All the graphical interfaces that Taipy GUI can generate are based on a set of generated files, including the web application and all the predefined visual elements.
- Taipy: A set of visual elements dedicated to Scenario Management.
Prerequisites: If you need to build the JavaScript bundle, you need to make sure that the
Node.js JavaScript runtime version 18 or above is installed on your
machine.
Note that Node.js comes with the npm
package manager as part
of the standard installation.
The build process is described in the Taipy GUI front-end and
Taipy front-end README files.
The Taipy GUI bundle must be built first, as the Taipy front-end code depends on it.
Here is the sequence of commands that can be issued to build both sets of files:
# Current directory is the repository's root directory
#
# Build the Taipy GUI bundle
cd frontend/taipy-gui
cd dom
npm i
cd ..
npm i
npm run build
#
# Build the Taipy front-end bundle
cd ../taipy # Current directory is [taipy-dir]/frontend/taipy
npm i
npm run build
These commands should create the directories taipy/gui/webapp
and taipy/gui_core/lib
in the
root directory of the taipy repository.
If you plan to modify the front-end code and need to debug the TypeScript code, you must use the following:
npm run build:dev
instead of the standard build option.
This will preserve the debugging symbols, and you will be able to navigate in the TypeScript code from your debugger.
Note: Web application location
When you are developing front-end code for the Taipy GUI package, it may be cumbersome to have to install the package over and over when you know that all that has changed is the JavaScript bundle that makes the Taipy web app.
By default, the Taipy GUI application searches for the front-end code in the
[taipy-gui-package-dir]/taipy/gui/webapp
directory.
You can, however, set the environment variableTAIPY_GUI_WEBAPP_PATH
to the location of your choice, and Taipy GUI will look for the web app in that directory.
If you set this variable to the location where you build the web app repeatedly, you will no longer have to reinstall Taipy GUI before you try your code again.
To run the tests on the package, you need to install the required development packages. We recommend using Pipenv to create a virtual environment and install the development packages.
pip install pipenv
pipenv install --dev
Then you can run the tests with the following command:
pipenv run pytest