Installation
sGameSolver can be installed using pip.
pip install sgamesolver
If you are using MacOS or a linux distribution, please check the according section under “Cython” below.
Installation with Anaconda
While sGameSolver works fine with the official Python distribution from python.org,
we strongly recommend using Anaconda
for numerical computations - the speedup provided by Anaconda
was sizeable on our systems when using sGameSolver.
If you do use Anaconda, make sure to install
numpy
, scipy
, pandas
, matplotlib
and cython
before installing sGameSolver.
Otherwise, these dependencies will be installed by pip
(rather than conda), which should be avoided.
The sequence should thus be
conda activate my_env
conda install numpy scipy pandas matplotlib cython
pip install sgamesolver
Compiling Cython
The performance-critical routines that evaluate the homotopy function \(H\) and its Jacobian \(J\) are written in Cython. Parts of sGameSolver may thus need to be compiled during installation. The following should let you know if that applies for your situation, and if yes, how to prepare your system:
We provide wheels for Python versions 3.6–3.10 via PyPI. Wheels are pre-built, so usually no steps from your side necessary when installing via pip.
Should you want or have to compile anyway, first identify the compiler required for your version of Python. Activate your virtual environment and run
python
in a terminal; you should see a line like
>>> python
Python 3.XXX ... [MSC v.1916 64 bit (AMD64)]
>>>
If the number is MSC v. 1916
, you need to
download
and install Microsoft build tools 2017,
if it is 1900
, you’ll need 2015.
When installing, make sure to check “Windows 10 SDK” as well.
Once that is done, you can install sGameSolver e.g. via pip.
As of now, no wheels yet (but we hope to provide them soon).
Before installing, make sure the
gcc
compilers are installed.When using Anaconda, Miniconda, or some other derivative, you might have to additionally install the package
gxx_linux-64
. Otherwise, the installation steps are the same as under Windows.
conda activate my_env
conda install numpy scipy pandas matplotlib cython gxx_linux-64
pip install sgamesolver
Unfortunately, we have neither experience nor an opportunity to test this setup.
Your best bet will be to find a guide on how to compile cython modules on MacOS, follow instructions and then install sGameSolver as above.
If you are having trouble relating to OpenMP support, check below how to install without.
If all else fails, you can install without Cython altogether (see below).
Installing without OpenMP
OpenMP is a standard for parallel computing; parts of sGameSolver’s Cython code make use of it.
Most compilers (especially linux’ gcc, MSVC on windows) support it.
However, if you have a different setup and experience any related problems during installation, you can disable it by installing via:
pip install sgamesolver --install-option="--no-openmp"
Installing without Cython
If all else fails, you can install sGameSolver without Cython support – in that case, it will fall back to a numpy implementation of the respective functions, which will be considerably slower however.
To do so, make sure
numpy
,scipy
,pandas
andmatplotlib
are installed. Then run:
pip install sgamesolver --install-option="--no-cython" --no-deps