Installing MesoMath#
Prerequisites#
Standard Installation Using pip or pipx#
pipx (Recommended for most users)#
This is the simplest way to install MesoMath as a standalone tool without worrying about Python environments.
$ pipx install mesomath
This will install the following MesoMath commands in your system’s PATH:
babcalc: The interactive Mesopotamian calculator.ibabcalc: The advanced Mesopotamian interactive calculator.
If you cannot run the commands after installation, try:
$ pipx ensurepath
To uninstall the package at any time, simply run:
$ pipx uninstall mesomath
pip (Virtual Environment)#
If you prefer using standard pip, it is highly recommended to use a virtual environment:
$python -m venv myenv$ source myenv/bin/activate # On Windows use: myenv\Scripts\activate
$ pip install mesomath
Once installed, you can run any of the tools directly (e.g., $ babcalc).
Font Configuration (Unicode Cuneiform)#
MesoMath requires a font compatible with the Unicode Cuneiform standard to correctly display the glyphs. We recommend Google’s Noto Sans Cuneiform.
1. Font Download#
Visit Google Noto Fonts.
Click on Download Family.
Unzip the
.zipfile to obtain theNotoSansCuneiform-Regular.ttffile.
2. Installation by Operating System#
🐧 Linux#
On most distributions, simply move the file to your local fonts directory:
Create the directory if it doesn’t exist:
mkdir -p ~/.local/share/fonts(or~/.fontson older systems).Copy the file:
cp NotoSansCuneiform-Regular.ttf ~/.local/share/fonts/Update the font cache:
fc-cache -f -v
🪟 [W] Windows#
Windows offers two methods, one of which does not require administrator privileges:
Quick Method: Right-click on the
.ttffile.Select “Install for all users” (requires Admin privileges) or simply “Install” (for the current user).
Alternatively, you can drag the file to the
C:\Windows\Fontsfolder.
🍎 macOS#
The process on Mac is very intuitive using the Font Catalog:
Double-click the
NotoSansCuneiform-Regular.ttffile.A preview window will open. Click the Install Font button.
The font will be automatically saved to
~/Library/Fontsand will be available to all your applications (including Terminal).
3. Verification#
Once installed, restart your terminal or IDE and run this test command in Python to confirm that the system recognizes the glyphs:
# Quick Render Test
print("\n\t𒄘 ╼60╾ 𒈠𒈾 ╼60╾ 𒂆\n")
If you see the cuneiform characters clearly (and not rectangles), the installation was a success!
𒁲 |
|
|---|---|
Status |
Environment Ready |
𒁲 |
⚙️ Editor Configuration (Optional)#
If you’re using a code editor, make sure to add ‘Noto Sans Cuneiform’ to your font family list so the internal console displays MesoMath results correctly.
VS Code#
Go to
Settings(Ctrl + ,).Search for
Editor: Font Family.Add
'Noto Sans Cuneiform'to the beginning of the list (e.g.,'Noto Sans Cuneiform', 'Consoles', 'Courier New').
PyCharm#
Go to
Settings>Editor>Font.Make sure the “Enable ligatures” box is checked and add the font as a “Fallback font” or primary font.
Developer Installation from Sources#
Clone the repository:
$ git clone https://github.com/jccsvq/mesomath.git
$ cd mesomath
We recommend using
hatchfor development:
$ hatch shell
This creates an isolated environment with all dependencies (including typing-extensions) and installs mesomath in editable mode.
Verification#
To verify the installation, check the version of the calculator:
$ babcalc --help
babcalc 2.1.0 - Command Line Interface
Usage:
babcalc Launch interactive REPL
babcalc <script.py> Execute a script
babcalc -i <script.py> Execute a script and stay in interactive mode
babcalc -m <module> Run a library module (Reserved for future use)
babcalc --help Show this message
jccsvq dub-sar fecit, 2025. Public domain.
Troubleshooting#
If you encounter issues during installation or while running the tools, check the following common solutions:
“Command not found” after installation#
This usually happens when your Python script directory is not in your system’s PATH.
**If using
pipx**: Runpipx ensurepathto automatically add the necessary directories to your profile.**If using
pip**: Ensure you have activated your virtual environment (source myenv/bin/activate) before running the commands.Manual Check: Verify that the scripts listed in
pyproject.toml(likebabcalcormtlookup) are present in your environment’sbin(Linux/macOS) orScripts(Windows) folder.
Python Version Mismatch#
MesoMath requires Python 3.10 or higher.
Check your version by running
$ python --version.If your system’s default
pythonis an older version (e.g., 3.8), try usingpython3instead:
$ python3 -m venv myenv
The package uses
typing-extensionsto ensure compatibility with modern type hints on older supported versions of Python.
Conflicts with other packages#
If you see errors related to dependency versions:
Isolated Environment: We strongly recommend using a virtual environment or
pipxto avoid conflicts with other installed Python tools.Hatch Users: If
hatch shellfails, try cleaning the environment first:
$ hatch env prune
SyntaxWarnings in Documentation (Developers)#
If you see a SyntaxWarning: invalid escape sequence when building the docs, ensure your conf.py uses a raw string for the copy button prompt:
# Correct way:
copybutton_prompt_text = r"--> |\.\.\. |\$ "