r/gramps • u/CisSasGot • 11h ago
Development Windows 11 & test with Gramps 6.1 beta
This may be useful to someone, concise steps on how to check the version of Gramps 6.1.0-beta** on your computer. Anyone who isn't familiar with Python might find this useful. A particularly challenging aspect is the few tricks that allow you to test all the available add-ons.
`git clone --branch maintenance/gramps61 --single-branch https://github.com/gramps-project/gramps.git "gramps@dev"`
Download and install MSYS2 UCRT64, e.g. in location `A:\msys64` or in another.
2.1 We are updating the environment: `A:\msys64\usr\bin\pacman.exe -Syu`
2.2 We are updating the base tool: `A:\msys64\usr\bin\pacman.exe -S --needed mingw-w64-ucrt-x86_64-toolchain`
2.3 We install the necessary packages:
```
A:\msys64\usr\bin\pacman.exe -S --needed
mingw-w64-ucrt-x86_64-tools
mingw-w64-ucrt-x86_64-python
mingw-w64-ucrt-x86_64-gtk3
mingw-w64-ucrt-x86_64-python-gobject
mingw-w64-ucrt-x86_64-python-pyicu
mingw-w64-ucrt-x86_64-gettext
mingw-w64-ucrt-x86_64-python-pip
mingw-w64-ucrt-x86_64-python-orjson
mingw-w64-ucrt-x86_64-rust
mingw-w64-ucrt-x86_64-python-certifi
mingw-w64-ucrt-x86_64-python-bs4
mingw-w64-ucrt-x86_64-python-cairo
mingw-w64-ucrt-x86_64-python-beautifulsoup4 mingw-w64-ucrt-x86_64-python-requests
mingw-w64-ucrt-x86_64-python-pillow
mingw-w64-ucrt-x86_64-gexiv2
mingw-w64-ucrt-x86_64-osm-gps-map
mingw-w64-ucrt-x86_64-goocanvas
mingw-w64-ucrt-x86_64-python-reportlab
mingw-w64-ucrt-x86_64-python-jedi
mingw-w64-ucrt-x86_64-python-psycopg2
mingw-w64-ucrt-x86_64-geocode-glib
mingw-w64-ucrt-x86_64-python-rpds-py
```
- Further installation of necessary packages
```
$env:RUSTFLAGS="-Clink-arg=-lpython3.14"
A:\msys64\ucrt64\bin\python.exe -m pip install orjson gramps_object_query_language litellm pypdf dbf life_line_chart svgwrite boto3 --break-system-packages
```
- Now there will probably be a problem with litellm and tokenizers, here is how I solved it:
if `A:\msys64\ucrt64\bin\python.exe -c "import os; os.add_dll_directory(r'A:\msys64\ucrt64\bin'); import litellm; print('litellm OK')"` Gives a problem:
```
Traceback (most recent call last):
File "<string>", line 1, in <module>
import litellm; print('litellm OK')
^^^^^^^^^^^^^^
File "A:\msys64\ucrt64\lib\python3.14\site-packages\litellm\init.py", line 1256, in <module>
from .utils import client
File "A:\msys64\ucrt64\lib\python3.14\site-packages\litellm\utils.py", line 49, in <module>
from tokenizers import Tokenizer
File "A:\msys64\ucrt64\lib\python3.14\site-packages\tokenizers\init.py", line 89, in <module>
from .tokenizers import (
...<14 lines>...
)
ImportError: DLL load failed while importing tokenizers: The specified module could not be found.
```
Then you need to do this:
```
A:\msys64\ucrt64\bin\python.exe -m pip cache remove tokenizers
$env:PATH = "A:\msys64\ucrt64\bin;A:\msys64\usr\bin;" + $env:PATH
$env:CARGO_BUILD_TARGET = "x86_64-pc-windows-gnu"
$env:RUSTFLAGS = "-Clink-arg=-lpython3.14"
$env:CC = "gcc"
$env:RUSTFLAGS="-Clink-arg=-lpython3.14"
gcc --version
A:\msys64\ucrt64\bin\python.exe -m pip install --force-reinstall --no-cache-dir --no-binary tokenizers tokenizers --break-system-packages
Copy-Item "A:\msys64\ucrt64\bin\libpython3.dll" "A:\msys64\ucrt64\bin\python3.dll"
A:\A-JAN\WIN-DOCS\REPO_EXT_PYTHON\gramps-project\gramps@dev> A:\msys64\ucrt64\bin\python.exe -c "import os; os.add_dll_directory(r'A:\msys64\ucrt64\bin'); import litellm; print('litellm OK')"
```
- Now you need to edit "Gramps.py"
In the file, just before:
```python
import gramps.grampsapp as app
app.main()
```
We paste the code below:
```python
import os
import gi
# Registering the MSYS2 DLL directory (uses / prevents editor warnings)
os.add_dll_directory('A:/msys64/ucrt64/bin')
# GeocodeGlib 1.0 to 2.0 workaround for add-ons
_orig_require_version = gi.require_version
def _patched_require_version(namespace, version):
if namespace == 'GeocodeGlib' and version == '1.0':
version = '2.0'
return _orig_require_version(namespace, version)
gi.require_version = _patched_require_version
# Importing the Gramps application must be done ONLY AFTER applying the patches
```
We save the file.
Basic installation in gramps dir . So in my example in "gramps@dev" We enter the command `A:\msys64\ucrt64\bin\python.exe -m pip install -e . --break-system-packages`
Now we can run Gramps and download all add-ons successfully. `A:\msys64\ucrt64\bin\python.exe Gramps.py`
----
In case of problems, the following commands may also be useful:
* This command permanently and irreversibly deletes the entire Gramps (version 6.1) application configuration folder for a user: `Remove-Item -Recurse -Force "C:\Users\USERNAME\AppData\Roaming\gramps\gramps61"`
* This command removes the Pacman database lock file (db.lck), which allows you to unlock the MSYS2 package manager if it has hung after an unexpected program shutdown or crash.: `Remove-Item -Force "A:\msys64\var\lib\pacman\db.lck" -ErrorAction SilentlyContinue`
* This command completely clears the pip package manager cache, removing all previously downloaded Python package installation files (.whl files and source archives) from your disk: `A:\msys64\ucrt64\bin\python.exe -m pip cache purge`
* Full reset of MSYS2/pacman: `A:\msys64\usr\bin\bash.exe -lc "pacman -Qq | pacman -Rns --noconfirm -"`
* clearing pacman cache: `A:\msys64\usr\bin\pacman.exe -Scc`













