Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

python: Install bindings #2593

Open
PhilippGackstatter opened this Issue Apr 7, 2019 · 5 comments

Comments

Projects
None yet
2 participants
@PhilippGackstatter
Copy link
Contributor

PhilippGackstatter commented Apr 7, 2019

I am trying to use the python-bindings in a Docker container running alpine (edge in this case). The documentation for the python binding only speaks of compilation, so I assumed the following steps would be all that I need.

Steps to Reproduce the Problem

docker run -it alpine:edge /bin/sh

Then inside the container

# The elektra package is only available in testing (I think)
echo "http://dl-cdn.alpinelinux.org/alpine/edge/testing" >> /etc/apk/repositories
# Install elektra and the python bindings
apk update && apk add elektra elektra-python
# Start python
python3
Python 3.6.8 (default, Mar 13 2019, 17:23:12) 
[GCC 8.3.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import kdb
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
ModuleNotFoundError: No module named 'kdb'

Expected Result

I expect the import of the kdb module to suceed.

Actual Result

ModuleNotFoundError: No module named 'kdb'

System Information

  • Elektra Version: elektra (0.8.21-r5)
  • Docker alpine:edge (Image ID 7da711226313).
@markus2330

This comment has been minimized.

Copy link
Contributor

markus2330 commented Apr 7, 2019

Thank you for creating this issue! It seems like that elektra-python only contains the python plugin but not the python binding. You are searching for apk add py3-elektra, then the import kdb works.

@PhilippGackstatter

This comment has been minimized.

Copy link
Contributor Author

PhilippGackstatter commented Apr 7, 2019

Thanks, that worked! I think there should be documentation on this either on the python-bindings tutorial or on the swig-python bindings page on libelektra.

@markus2330

This comment has been minimized.

Copy link
Contributor

markus2330 commented Apr 7, 2019

Feel free to add this information with a PR in the python-bindings tutorial. The Alpine docker image seems to be an easy way to try out Elektra, see also #2585

@PhilippGackstatter

This comment has been minimized.

Copy link
Contributor Author

PhilippGackstatter commented Apr 7, 2019

I'll make a PR shortly. Regarding #2585, I was running a plain alpine image, not the one built with the script in this repo since I want to add elektra to an extisting application that is running in an alpine container.

@markus2330

This comment has been minimized.

Copy link
Contributor

markus2330 commented Apr 8, 2019

In the PR you can describe both variants (plain alpine and alpine image from our repo).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.