Skip to main content

No project description provided

Project description

Python Bindings

How to install this

This project is currently work in progress, and is to be considered for all intents and porposes an alpha version.

To install the latest (alpha) release, run the following:

pip install ensmallen

Compile the bindings

The project uses PyO3 and maturin. You need nightly rust in order to compile PyO3. This could be done by running:

curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh --default-toolchain nightly --profile default -y

Then we need to install maturin with:

cargo install maturin

And finally we can create the Wheels with:

maturin build --release

The wheels will be located in ./target/wheels/.

Compile the bindings for multiple Python versions

By default maturin will build for the installed python version.

To install other Python versions just run:

wget https://www.python.org/ftp/python/${PYTHON_VERSION}/Python-${PYTHON_VERSION}.tar.xz
tar -xf Python-${PYTHON_VERSION}.tar.xz
(cd Python-${PYTHON_VERSION}; ./configure --enable-optimizations; make -j$(nproc); make -j$(nproc) install)

Where ${PYTHON_VERSION} is the choosen version, such as 3.8.3 or 3.6.10.

Solving the GLIBC__2.29__ not found error

This means that the linux package were built on a system with a really new Libc version. This can be solved by compiling your own bindings. In order to be compatible with as many systems as possible, we suggest to build them on the official Manylinux1 docker.

Compiling the bindings for Linux to push them to Pipy

In order to make the wheels usable by any linux system we must follow the manylinux2010 standard. We used to support manylinux1 but rust no longer support Glibc 2.5 so we had to bump it to the next standard.

To specify for which versions you wish to build the bindings just modify the folliowing line inside of ./ensmallen/setup/DockerFileManyLinux2010:

ENV PATH /opt/python/cp36-cp36m/bin/:/opt/python/cp37-cp37m/bin/:/opt/python/cp38-cp38/bin/:/opt/python/cp39-cp39/bin/:$PATH

This can be done by building the bindings inside a centos5 docker with:

git clone https://github.com/LucaCappelletti95/ensmallen
cd ensmallen
make build_manylinux2010 python_manylinux2010

The result wheels will be in ./ensmallen/bindings/python/target/wheels/.

A wheel will be created for each version of python, this is configurable in the Dockerfile ./ensmallen/setup/DockerFileManylinux2010 in a ENV var.

A tutorial on how the internals of Python's Cffi can be found here

Project details


Release history Release notifications | RSS feed

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distributions

No source distribution files available for this release.See tutorial on generating distribution archives.

Built Distributions

ensmallen-0.7.0.dev11-cp310-cp310-manylinux_2_12_x86_64.manylinux2010_x86_64.whl (16.8 MB view details)

Uploaded CPython 3.10 manylinux: glibc 2.12+ x86-64

ensmallen-0.7.0.dev11-cp39-cp39-manylinux_2_12_x86_64.manylinux2010_x86_64.whl (16.8 MB view details)

Uploaded CPython 3.9 manylinux: glibc 2.12+ x86-64

ensmallen-0.7.0.dev11-cp38-cp38-manylinux_2_12_x86_64.manylinux2010_x86_64.whl (16.8 MB view details)

Uploaded CPython 3.8 manylinux: glibc 2.12+ x86-64

ensmallen-0.7.0.dev11-cp37-cp37m-manylinux_2_12_x86_64.manylinux2010_x86_64.whl (16.7 MB view details)

Uploaded CPython 3.7m manylinux: glibc 2.12+ x86-64

ensmallen-0.7.0.dev11-cp36-cp36m-manylinux_2_12_x86_64.manylinux2010_x86_64.whl (16.7 MB view details)

Uploaded CPython 3.6m manylinux: glibc 2.12+ x86-64

File details

Details for the file ensmallen-0.7.0.dev11-cp310-cp310-manylinux_2_12_x86_64.manylinux2010_x86_64.whl.

File metadata

File hashes

Hashes for ensmallen-0.7.0.dev11-cp310-cp310-manylinux_2_12_x86_64.manylinux2010_x86_64.whl
Algorithm Hash digest
SHA256 633d87561969cb1958db02a595d70994707b4456d8f6d4fffe08ad52acb38bb6
MD5 2d23c4dae375e7546a47cfe83975b1bd
BLAKE2b-256 582af177abf163c5b35027aa4c23d131846d8c5248afb60b5edf220827f5bde5

See more details on using hashes here.

File details

Details for the file ensmallen-0.7.0.dev11-cp39-cp39-manylinux_2_12_x86_64.manylinux2010_x86_64.whl.

File metadata

File hashes

Hashes for ensmallen-0.7.0.dev11-cp39-cp39-manylinux_2_12_x86_64.manylinux2010_x86_64.whl
Algorithm Hash digest
SHA256 e5269c08549c4966953b9586f4abb86f9923fb72cb3bfaab25cb5d5738ec9d56
MD5 cc2b9e811510a0365a5d1275ca8a1a1e
BLAKE2b-256 8ea6245d6f7474053199fb4cf251d7f5e7351783b0bf4fb92ce1bf25931e08f1

See more details on using hashes here.

File details

Details for the file ensmallen-0.7.0.dev11-cp38-cp38-manylinux_2_12_x86_64.manylinux2010_x86_64.whl.

File metadata

File hashes

Hashes for ensmallen-0.7.0.dev11-cp38-cp38-manylinux_2_12_x86_64.manylinux2010_x86_64.whl
Algorithm Hash digest
SHA256 d7778d1a6169d47fae4fc65d4a684c038e6d3427cec2b63e67375f0b08767e79
MD5 25193b1d5258a7565ff2e5df9618c36f
BLAKE2b-256 3960f2baeee13bb469094e07964afc11878ae9442448e6c451109e4579719a35

See more details on using hashes here.

File details

Details for the file ensmallen-0.7.0.dev11-cp37-cp37m-manylinux_2_12_x86_64.manylinux2010_x86_64.whl.

File metadata

File hashes

Hashes for ensmallen-0.7.0.dev11-cp37-cp37m-manylinux_2_12_x86_64.manylinux2010_x86_64.whl
Algorithm Hash digest
SHA256 a83a26c87677e408724ca2300d91ba8268571940faf066bf5d63b0d1d5794c50
MD5 9e1cdbf598acbaa32a9f448186f4ae95
BLAKE2b-256 dd3722b67185c87d4fece6954924aca97b8ed75def2d0f94e9e43b01873475ad

See more details on using hashes here.

File details

Details for the file ensmallen-0.7.0.dev11-cp36-cp36m-manylinux_2_12_x86_64.manylinux2010_x86_64.whl.

File metadata

File hashes

Hashes for ensmallen-0.7.0.dev11-cp36-cp36m-manylinux_2_12_x86_64.manylinux2010_x86_64.whl
Algorithm Hash digest
SHA256 82a335932cf3e368e576055fa8fbe36895a0259108a2e922b04c592fe6777c50
MD5 53cb8e6de041ffecb02204efb2021610
BLAKE2b-256 d126dce43d11a3b050701b1d22d16ec273fea3862a606b75627f9be11805678f

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page