Main repository for all data analysis related to LEXI
The next section of this document will guide you through the installation process of lexi
.
Though it is not necessary, we strongly recommend that you install Lexi in a virtual environment. This will prevent any conflicts with other Python packages you may have installed.
A virtual environment is a self-contained directory tree that contains a Python installation for a particular version of Python, plus a number of additional packages. You can install packages into a virtual environment without affecting the system Python installation. This is especially useful when you need to install packages that might conflict with other packages you have installed.
There are several ways to create a virtual environment. We recommend using python3
to do so.
For this exercise, we will assume that you have a directory called Documents/lexi
where you will
install Lexi and create your virtual environment. Please replace Documents/lexi
with the actual
path to the directory where you want to install Lexi and create your virtual environment.
- cd into
Documents/lexi
You can create a virtual environment called lexi_venv
(or any other name you might like) using
python3
by running the following command:
python3 -m venv lexi_venv
You can activate the virtual environment by running the following command:
source lexi_venv/bin/activate
.\lexi_venv\Scripts\activate.bat
You can deactivate the virtual environment by running the following command:
deactivate
After you have created and activated your virtual environment, you can install Lexi directly from GitHub by running the following command:
pip install git+https://github.com/Lexi-BU/lexi
After you have created and activated your virtual environment, you can install Lexi from a local copy by following these steps:
-
Download
lexi-version.tar.gz
directory from the following link: Download LEXI Software -
Copy the
lexi-version.tar.gz
file intoDocuments/lexi
(or any other directory where you want to install Lexi in). -
Activate your virtual environment using the instructions above.
-
Install Lexi by running the following command (NOTE: replace
lexi-version.tar.gz
with the actual name of the file you downloaded):pip install lexi-version.tar.gz
This will install Lexi and all its dependencies.
You can verify that Lexi was installed by running the following command:
pip show lexi
which should produce output similar to the following:
Name: lexi
Version: 0.0.1
Summary: Main repository for all data analysis related to LEXI
Home-page:
Author: qudsiramiz
Author-email: qudsiramiz@gmail.com
License: GNU GPLv3
Location: /home/cephadrius/Desktop/lexi_code_test_v2/lexi_test_v2/lib/python3.10/site-packages
Requires: cdflib, matplotlib, pandas, pytest, toml
Required-by:
You can also verify that Lexi was installed by running the following command:
pip list
which should produce output similar to the following:
Package Version
--------------- -------
.....................
kiwisolver 1.4.5
lexi 0.0.1
matplotlib 3.8.2
numpy 1.26.4
.....................
You can open a Python shell and import Lexi by running the following command:
python
import lexi
lexi.__version__
which should produce output similar to the following:
'0.0.1'
If that worked, congratulations! You have successfully installed Lexi.
NOTE: We will add more examples and tutorials in the future. For now, we will use a Jupyter Notebook
to demonstrate how to use lexi
to analyze data from LEXI.
-
If you haven't already, download the example folder from the following link: Download LEXI Examples and extract it to a directory of your choice. We will refer to this directory as
examples
for the rest of this document. -
Activate your virtual environment. If you haven't already created a virtual environment, please refer to the creating a virtual environment section for instructions on how to do so. Remeember that you can activate your virtual environment by running the following command:
source lexi_venv/bin/activate
.\lexi_venv\Scripts\activate.bat
-
cd
into theexamples
directory and -
If you haven't already, install Jupyter Notebook by running the following command:
pip install jupyter
- Open the Jupyter Notebook by running the following command:
jupyter notebook lexi_tutorial.ipynb
- This will open a new tab in your web browser and will look like the image below:
- You can now run the cells in the Jupyter Notebook to see how to use
lexi
to analyze data from LEXI.