Getting Started#
Virtual Environments#
We strongly recommend you to use python’s virtual environments to manage your python packages.
Virtual environments allow you to isolate the python packages you need for each project and prevent conflicts between the dependencies of different projects.
One way of creating and virtual environments using venv is given below:
make sure that you have
venvinstalled, e.g. on Ubuntu thepython3-venvapt-packagecreate a new virtual environment in your current directory with
python3 -m venv .venv
This will now create a
.venvdirectory which can contain python packages and executablesactivate the environment
source .venv/bin/activate
This will now cause
pythonandpipto use this environment, as well as make any executables in that environment available in yourPATH.
Installing GVEC#
In the best case, GVEC can be installed with its python bindings using:
pip install gvec
For system requirements and more information see the installation page.
To confirm GVEC is installed and working, call pygvec --version in the terminal, or import gvec in a python session.
On the tutorials#
Each subsection is a Jupyter notebook, displayed after its execution. You can follow the link in the right sidebar to download or browse the source code.
We recommend going through the notebooks in the order of this section.
You can also simply download all notebooks as a zip file.
The available tutorials are:
Running Jupyter notebooks#
The GVEC tutorials are mostly organized in Jupyter notebooks (also called ipython notebooks). You can however also follow along with a normal python script.
To use the notebooks you need to have the following packages installed:
pip install jupyter ipykernel ipympl ipywidgets matplotlib
We recommend two options for running Jupyter notebooks:
Visual Studio Code with the
jupyterextensionThe jupyter notebook browser interface
Here need to make the virtual environment visible (
.venvmust the activated!) withpython3 -m ipykernel install --user --name .venv
and then start
jupyter notebook &
When you open a notebook, you should be prompted which kernel to use.
Select the environment where you installed gvec, e.g. .venv.