This guide provides step-by-step instructions for installing pyglotaran on Windows, macOS, and Linux systems. It starts with installing pyglotaran if you already have Python installed, ensuring the use of virtual environments to keep your system clean. If you don't have Python installed yet, we'll guide you through installing Python on your system.
Before installing pyglotaran, ensure you have:
- Python 3.10 or higher installed on your system.
- Basic familiarity with command-line interfaces.
Open your terminal or command prompt and run:
python --version
or
python3 --version
If Python is installed, this command will display the Python version number.
- If the version is 3.10 or higher, proceed to installing pyglotaran.
- If you see a lower version number or receive an error message, proceed to Installing Python on Your System.
💡 It is recommended to use a virtual environment to install pyglotaran into, to avoid possible conflicts with other Python packages and to keep your system Python environment clean.
Create a new project folder. This could also be a folder downloaded from the examples.
Create a virtual environment named venv.
For Windows:
python -m venv venv
(on MacOS/Linux) you may have to use python3
instead of python
.
Within your project folder run the following.
For Windows:
venv\Scripts\activate
For MacOS/Linux:
source venv/bin/activate
After activation, your command prompt should be prefixed with (venv).
Install pyglotaran using pip
pip install pyglotaran
To verify that pyglotaran is installed correctly, run:
python -c "import pyglotaran; print(pyglotaran.__version__)"
If the installation was successful, this command will print the version number of pyglotaran.
If you don't have Python installed, follow the instructions below for your operating system.
- Open the Microsoft Store app.
- Search for Python and select the latest version (Python 3.10 or higher).
- Click Get or Install.
*Note: This method installs Python only for the current user and doesn't require administrative privileges.*
- Go to the official Python website.
- Download the latest Python installer (Python 3.10 or higher).
- Run the installer:
- Check the box that says "Add Python to PATH".
- Choose "Install Now" for a default installation.
- Install Homebrew if you haven't already:
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
- Install Python:
brew install python
- Visit the official Python website.
- Download the latest Python installer (Python 3.10 or higher).
- Run the installer and follow the prompts.
Update the package list:
sudo apt update
Install Python and pip:
sudo apt install python3 python3-venv python3-pip
Refer to your distribution's package manager documentation to install Python 3.10 or higher, python3-venv, and python3-pip.
Now that you have Python and pyglotaran installed, you can start using pyglotaran for your data analysis.
pyglotaran is designed to be used within Python scripts or Jupyter Notebooks. It involves defining your analysis scheme, which includes:
- A model: Defines the kinetic scheme of your system.
- Parameters: Initial guesses and constraints for the model parameters.
- Experimental data: The data you want to fit.
You then use pyglotaran to optimize the model parameters to fit your data.
If you plan to use pyglotaran within Jupyter Notebooks, install Jupyter Notebook in your virtual environment:
pip install jupyterlab
Then, start the Jupyter Notebook server:
jupyter lab
This will open the Jupyter Notebook interface in your web browser.
We have prepared comprehensive examples in the form of Jupyter Notebooks in the pyglotaran-examples repository. These examples illustrate how to use the framework for various use cases.
To get started:
-
Clone or download the repository:
git clone https://github.com/glotaran/pyglotaran-examples.git
-
Navigate to the example that best matches your use case.
-
Run the Jupyter Notebook to see pyglotaran in action.