Installation & Environment Setup

Aryanto
August 22, 2026
2 min read

For released builds, install CoopRecSys from PyPI inside an isolated Python environment.

python -m venv .venv
source .venv/bin/activate

python -m pip install --upgrade pip
python -m pip install cooprecsys

On Windows PowerShell:

py -3.12 -m venv .venv
.\.venv\Scripts\Activate.ps1
python -m pip install --upgrade pip
python -m pip install cooprecsys

Verify the package

python -c "import cooprecsys; print(cooprecsys.__file__)"

For Ary2Tower, verify the native backend too:

from cooprecsys.models.ary2tower.towers import backend_info
print(backend_info())

The result tells you whether the compiled Cython/OpenMP path is available. The Python API remains usable through NumPy when native modules are unavailable.

Source checkout

git clone https://github.com/masterofray/cooprecsys.git
cd cooprecsys
python -m venv .venv
source .venv/bin/activate
python -m pip install --upgrade pip

Build Ary2Tower Cython extensions

The development build entry point is deliberately inside the model package:

python ./src/cooprecsys/models/ary2tower/a2tcysetup.py build_ext --inplace

This command compiles the five CLtowers extension modules in place so the normal Python imports resolve them directly from the package directory.

Unix helper:

./src/cooprecsys/models/ary2tower/cysetup.sh

PowerShell helper:

.\src\cooprecsys\models\ary2tower\cysetup.ps1

When packaging for a wheel, compile inside the CI matrix rather than relying on a developer’s local binary ABI. Consumers should install the resulting wheel rather than recompiling it.

Source build dependencies

A native build requires a compatible C/C++ toolchain, Python development headers, Cython, NumPy, and an OpenMP-capable compiler/runtime appropriate to the host platform.

Supported release matrix

The repository release workflow targets CPython 3.10–3.13 for Linux x86_64 and Windows x86_64 wheels. Validate the imported package in each target environment rather than treating a successful compilation alone as sufficient.

Troubleshooting native imports

If the Cython build succeeds but backend_info() still reports the NumPy path, check:

  1. the extension files exist inside models/ary2tower/CLtowers;
  2. the extension names match the current Python ABI;
  3. the current working tree is the one imported by Python (print(cooprecsys.__file__));
  4. no stale build directory shadows the package;
  5. the wheel contains the compiled extension modules.
Last updated on August 22, 2026

Was this article helpful?

Your response is saved on this device.