Skip to content

Python Virtual Environment

Info

Everything here below are written for Linux command line environment. If you are not familiar with it, you should first finish Linux Environment.

venv is a lightweight module that comes with Python installation. You can already use it if you have installed Python. However, on some Linux distributions, you still need to install the python-venv version of Python. However, some Python package depends some non-Python packages, e.g. boost, then install using conda is still a better way.

Make sure you have installed Python

You should install Python before creating virtual environment. You can download it here and install it by yourself.

Create a virtual environment using venv

mkdir matsci
python -m venv matsci
This will create a virtual environment using the name matsci and the environment will be saved into matsci. If you want to choose the specific version of Python (e.g. 3.12), you just use:
python3.12 -m venv matsci

Activate virtual environment

source matsci/bin/activate
This will activate matsci.

Install packages

Just use pip install to install packages from PyPI.

pip install numpy scipy matplotlib seaborn pandas pymatgen phonopy ase pytables scikit-learn numba glob2 jupyter

Install MACE

If you want to install MACE, you can use

pip install mace-torch
If you want to install a specific branch of MACE from GitHub, e.g. multi-head-interface , you can use
pip install git+https://github.com/ACEsuit/mace.git@multi-head-interface

Deactivate virtual environment

Just type deactivate to quit this virtual environment.