# Libadalang python bindings from Alire

**URL:** <https://forum.ada-lang.io/t/libadalang-python-bindings-from-alire/4550>\
**Category:** Help\
**Created:** [July 7, 2026, 8:41am UTC](https://forum.ada-lang.io/t/libadalang-python-bindings-from-alire/4550 "2026-07-07T08:41:15Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![ThyMYthOS](https://forum.ada-lang.io/user_avatar/forum.ada-lang.io/thymythos/32/870_2.png) [@ThyMYthOS](https://forum.ada-lang.io/u/ThyMYthOS)\
**Post date:** [July 7, 2026, 8:41am UTC](https://forum.ada-lang.io/t/libadalang-python-bindings-from-alire/4550/1 "2026-07-07T08:41:16Z")

</div>

@Fabien.C do you know if it’s possible to use the python bindings with the version of libadalang in Alire? It seems that Alire only builds a static library that cannot be used by Python.

Also: Would it be possible to publish a package on pypi?

---

<div class="post-metadata">

**Author:** ![Seirios](https://forum.ada-lang.io/user_avatar/forum.ada-lang.io/seirios/32/829_2.png) [@Seirios](https://forum.ada-lang.io/u/Seirios)\
**Post date:** [July 7, 2026, 8:51pm UTC](https://forum.ada-lang.io/t/libadalang-python-bindings-from-alire/4550/2 "2026-07-07T20:51:13Z")

</div>

Hi!

I recently had a similar issue but managed to get the `lal_playground` working.

The solution is not optimal, but here’s what worked for me (I did this on macOS, but should be similar on Linux, just change `.dylib` to `.so`):

```bash
$ alr get libadalang

# change to libadalang crate directory
$ alr build --release -- -XLIBRARY_TYPE=relocatable

```

After the compilation of all the dependencies and the package itself finished, I manually copied the built shared libraries to inside my library path.

```bash
# change to $HOME/.local/share/alire/builds
# assumes no other crates present, otherwise filter
$ find . -name '*.dylib' -execdir cp {} /usr/local/lib \;

# change to libadalang crate directory
$ cp lib/relocatable/prod/libadalang.dylib /usr/local/lib

```

For the Python side of things, I used a virtualenv:

```bash
$ python -mvenv $HOME/env_lal
$ source $HOME/env_lal/bin/activate

# change to langkit_support crate directory
$ pip install -r requirements-github.txt
$ pip install -r requirements-pypi.txt
$ pip install ipython
$ pip install .

# change to libadalang crate directory
$ pip install ./python

```

Finally, to run the playground script:

```bash
$ source $HOME/env_lal/bin/activate

# change to libadalang crate directory
$ ./scripts/lal_playground <FILE>

```

Hope this helps 🙂

---

<div class="post-metadata">

**Author:** ![ThyMYthOS](https://forum.ada-lang.io/user_avatar/forum.ada-lang.io/thymythos/32/870_2.png) [@ThyMYthOS](https://forum.ada-lang.io/u/ThyMYthOS)\
**Post date:** [July 7, 2026, 9:04pm UTC](https://forum.ada-lang.io/t/libadalang-python-bindings-from-alire/4550/3 "2026-07-07T21:04:37Z")

</div>

Thanks, totally forgot about `alr get`!

---

<div class="post-metadata">

**Author:** ![system](https://forum.ada-lang.io/uploads/default/original/1X/e625e7957e269cbf6d3128dab48a9e54fe3a9bdc.png) [@system](https://forum.ada-lang.io/u/system)\
**Post date:** [July 23, 2026, 6:28pm UTC](https://forum.ada-lang.io/t/libadalang-python-bindings-from-alire/4550/4 "2026-07-23T18:28:14Z")

</div>

This topic was automatically closed 24 hours after the last reply. New replies are no longer allowed.
