Skip to content

Latest commit

 

History

History

mojo-plotter

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 
 
 
 
 

Mojo Plotter

This is supporting content for the video tutorial: Cross Platform Mojo App with Conda, PyTorch and Matplotlib

Latest working version: 24.01

Installation

Conda

If you don't have conda, install miniconda here

Create conda environment

Create and activate conda environment:

General

conda env create -f environment.yaml
conda activate mojo-plotter

Auto Set Mojo Environment

To automatically set Mojo to use the python environment when you activate it:

Macos/Linux

mkdir -p $CONDA_PREFIX/etc/conda/activate.d
export MOJO_PYTHON_LIBRARY="$(find $CONDA_PREFIX/lib -iname 'libpython*.[s,d]*' | sort -r | head -n 1)"
echo "export MOJO_PYTHON_LIBRARY=\"$MOJO_PYTHON_LIBRARY\"" > $CONDA_PREFIX/etc/conda/activate.d/export-mojo.sh

mkdir -p $CONDA_PREFIX/etc/conda/deactivate.d
echo "unset MOJO_PYTHON_LIBRARY" > $CONDA_PREFIX/etc/conda/deactivate.d/unset-mojo.sh

Usage

Simply activate the environment and run the program:

conda activate mojo-plotter
mojo main.mojo