Warning

You are reading the documentation related to the development version. Go here if you are looking for the documentation of the stable release.

Install in Google Colaboratory (Colab)

Maybe you want to try or run SpectroChemPy without installing python and all the necessary packages on your computer.

To do this you can use Colaboratory, in short Colab, which allows you to run python notebooks in your browser without any installation.

The Colab Notebooks are very similar to Jupyter Notebook (from which they derive).

To start with Colab, go to the Colab website and create a new notebook or simply execute the example notebook on Colab Open in Colab

Load and install SpectroChemPy with pip

In the first cell, enter and execute the following block of instructions to load and install SpectroChemPy in Colab.

! pip install spectrochempy &>> output.log
exit()

Note

The whole process takes 1-2 minutes. The exit() instruction allows restarting runtime automatically: do not pay attention to the popup messages about session crash/restart. You can safely close them.

Then as usual in Jupyter Notebook you can start using SpectroChemPy by inserting adding new code cells:

Colab windows

Warning

Colab notebooks are isolated and thus you need to perform the above operation for all notebook you create… and to run it each time you reopen the notebook for further processing or analysis.

Load data files

As Colab notebooks are hosted on Google servers, they have no direct access to your local drive (unlike a Jupyter notebook for instance). There are several ways to load datafiles on the server:

  • Through the file-explorer pane located on the left-hand side of the Colab window (NOT the File menu which is devoted to notebooks and scripts management !),

  • Equivalently by importing the files module from the google.colab library and runing the files.upload() widget (works best on Google Chrome).

from google.colab import files
files.upload()
  • By connecting the notebook to your Google Drive (this of course requires that your local files are synchronized with Google drive), using the file-explorer pane.

  • By cloning a GitHub repository using git clone .

Colab windows