Installation
Use automesh
from one of the following interfaces:
- command line interface,
- Rust interface, or
- Python interface.
All interfaces are independent from each other:
- The Rust interfaces can be used without the Python interface.
- The Python interface can be used without the Rust interfaces.
For macOS and Linux, use a terminal. For Windows, use a Command Prompt (CMD) or PowerShell.
Step 1: Install Prerequisites
- The command line interface and Rust interface depend on Rust and Cargo.
- Cargo is the Rust package manager.
- Cargo is included with the Rust installation.
- The Python interface depends on Python and pip.
- pip is the Python package installer.
- pip is included with the standard installation of Python starting from Python 3.4.
Rust Prerequisites
Install Rust and Cargo for your operating system:
macOS and Linux
- Open a terminal. Install Rust using
rustup
:
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh
- Follow the on-screen instructions to complete the installation.
- Add Cargo's bin directory to your
PATH
:
source $HOME/.cargo/env
Windows
- Download and run the Rust installer.
- Follow the installation instructions in the command prompt.
- Ensure that Cargo's bin directory is in your
PATH
. You may need to restart your command prompt or system.
Python Prerequisites
macOS
- Install Homebrew (if you don't have it already). Open the Terminal and run:
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
- Install Python. After Homebrew is installed, run:
brew install python
- Verify Python and pip are installed:
python3 --version
pip3 --version
Linux
- Update Package List. Open a terminal and run:
sudo apt update
- Install Python and pip. For Ubuntu or Debian-based systems, run:
sudo apt install python3 python3-pip
- Verify Python and pip are installed:
python3 --version
pip3 --version
Windows
- Download Python. Go to the official Python website and download the latest version of Python for Windows.
- Run the Installer. During installation, make sure to check the box that says "Add Python to PATH."
- Verify Python and pip are installed:
python --version
pip --version
All Environments
On all environments, a virtual environment is recommended, but not required. Create a virtual environment:
python3 -m venv .venv
Activate the virtual environment:
source .venv/bin/activate # for bash shell
source .venv/bin/activate.csh # for c shell
source .venv/bin/activate.fish # for fish shell
.\.venv\Scripts\activate # for powershell
Step 2: Install automesh
Install the desired interface.
Command Line Interface
cargo install automesh
Rust Interface
cargo add automesh
Python Interface
pip install automesh
Step 3: Verify Installation
Rust Interfaces
automesh
Python Interface
python
# In Python, import the module
>>> import automesh
# List all attributes and methods of the module
>>> dir(automesh)
# Get help on the module
>>> help(automesh)