Installation¶
There are different ways to install scikit-lr:
Install the latest official release. This is the best approach for most users. It will provide a stable version and pre-built packages are available for most platforms.
Install the development build. This is best for users who want the latest-and-greatest features and are not afraid of running brand-new code.
Building the package from source. This is needed for users who wish to contribute to the project.
Installing the latest release¶
Scikit-lr can be installed via pip from PyPi:
pip install -U scikit-lr
In order to check your installation, you can use:
pip show scikit-lr
pip freeze
python -c "import sklr; sklr.__version__"
Note that in order to avoid potential conflicts with other packages, it is strongly recommended to use a virtual environment or conda environment.
Using an isolated environment makes possible to install a specific version of scikit-lr and its dependencies independently of any previously installed Python packages. In particular, under Linux is it discouraged to install pip packages alongside the packages managed by the package manager of the distribution.
If you have not installed NumPy or SciPy yet, you can also install these.
Please, ensure that binary wheels are used, and NumPy and SciPy are not
recompiled from source, which can happen when using particular configurations
of operating system and hardware. You can install scikit-lr and its
dependencies with scikit-lr[alldeps].
Warning
Scikit-lr requires Python 3.6 or newer, and Windows is not currently supported.
Note
You should always remember to activate the environment of your choice prior to running any Python command whenever you start a new terminal session.
Note
To make it easier to get up and running with scikit-lr, you can use the official Docker image.
Installing the development build¶
The continuous deployment servers of the scikit-lr project build, test and upload wheel packages for the supported Python versions based on push to the master branch.
Installing a development build is the quickest way to:
Try a new feature that will be shipped in the next release.
Check whether a bug you encountered has been fixed since the last release.
To install the development build from the Anaconda repository:
pip install --index https://pypi.anaconda.org/alfaro96/simple scikit-lr
Note
The development build of scikit-lr is also provided via the official Docker image.
Building from source¶
Building from source is required to work on a contribution (bug fix, new feature, code or documentation improvement):
Use Git to checkout the latest source from the scikit-lr repository on GitHub:
git clone git://github.com/alfaro96/scikit-lr.git cd scikit-lr
Optional (but recommended): Create and activate a dedicated virtual environment or conda environment.
Install a C and C++ compiler for your platform, either system-wise (see instructions for Linux and macOS) or with conda-force to get full isolation.
Install Cython and build the project with pip in editable mode:
pip install cython pip install --verbose --no-build-isolation --editable .
Check that the installed scikit-lr has a version number ending with
.dev0:python -c "import sklr; sklr.__version__"
Run the tests on the module of your choice via pytest.
Note
You can use the official Docker image to setup a development environment.
Note
If you plan on submitting a pull-request, you should clone from your fork instead.
Note
If you want to build a stable version, you can git checkout <VERSION>
after checking out the latest source to get the code for that particular
version.
Note
You will have to run the pip install --no-build-isolation --editable .
command every time the source code of a Cython file is updated (ending in
.pyx or .pxd). Use the --no-build-isolation flag to avoid compiling
the whole project each time, only the files you have modified.
Dependencies¶
Scikit-lr requires the following dependencies:
Runtime |
Build |
Tests |
|---|---|---|
Python (>= 3.6)
NumPy (>= 1.17.3)
SciPy (>= 1.3.2)
|
Cython (>= 0.29.14)
C and C++ compiler
|
Pytest (>= 4.6.4)
|
Note
The runtime dependencies are automatically installed by pip if they were missing when building scikit-lr from source.