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.dev14-cp36-abi3-manylinux_2_12_x86_64.manylinux2010_x86_64.whl (16.8 MB view details)

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

ensmallen-0.7.0.dev14-cp36-abi3-macosx_10_7_x86_64.whl (14.5 MB view details)

Uploaded CPython 3.6+ macOS 10.7+ x86-64

File details

Details for the file ensmallen-0.7.0.dev14-cp36-abi3-manylinux_2_12_x86_64.manylinux2010_x86_64.whl.

File metadata

  • Download URL: ensmallen-0.7.0.dev14-cp36-abi3-manylinux_2_12_x86_64.manylinux2010_x86_64.whl
  • Upload date:
  • Size: 16.8 MB
  • Tags: CPython 3.6+, manylinux: glibc 2.12+ x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.8.0 pkginfo/1.8.2 readme-renderer/34.0 requests/2.27.1 requests-toolbelt/0.9.1 urllib3/1.26.9 tqdm/4.63.1 importlib-metadata/4.11.3 keyring/23.5.0 rfc3986/2.0.0 colorama/0.4.4 CPython/3.7.13

File hashes

Hashes for ensmallen-0.7.0.dev14-cp36-abi3-manylinux_2_12_x86_64.manylinux2010_x86_64.whl
Algorithm Hash digest
SHA256 653a419575afa7dd671b93df6f6eccc20b54f8d8f3aea463a464304d3dad58bc
MD5 06a5c9275b49b6046ef5358a3923484d
BLAKE2b-256 1b70a8a432c7a3d3c99e847acaf44cc3742882582f6fed9d95cf406b459cffdb

See more details on using hashes here.

File details

Details for the file ensmallen-0.7.0.dev14-cp36-abi3-macosx_10_7_x86_64.whl.

File metadata

  • Download URL: ensmallen-0.7.0.dev14-cp36-abi3-macosx_10_7_x86_64.whl
  • Upload date:
  • Size: 14.5 MB
  • Tags: CPython 3.6+, macOS 10.7+ x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.8.0 pkginfo/1.8.2 readme-renderer/34.0 requests/2.27.1 requests-toolbelt/0.9.1 urllib3/1.26.9 tqdm/4.63.1 importlib-metadata/4.11.3 keyring/23.5.0 rfc3986/2.0.0 colorama/0.4.4 CPython/3.7.9

File hashes

Hashes for ensmallen-0.7.0.dev14-cp36-abi3-macosx_10_7_x86_64.whl
Algorithm Hash digest
SHA256 fb0c72bea3e8056bda2f4b5d1ddc53c24220ec33493de2f5ada290d8279b5010
MD5 a8dacb1b087cd53eb8518ceb28899668
BLAKE2b-256 2ae5f0c6b756d187b023d67400c81739fd20e69faf34d678d283418a08322cef

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