You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
If libmagic is not installed you get an ImportError,
I think it should be reported some other way, preferibably it should say that it's missing at pip install time. Or preferably install it automatically somehow.
I see that there was some work for that but it doesn seem to work on alpine at least , see the steps to reproduce below
Steps to reproduce
docker run --rm -ti alpine:3.18
apk add git gettext helm curl python3 python3-dev py3-pip make g++ go
python -m venv kapitan-venv
source kapitan-venv/bin/activate
pip install -U pip
pip install -U kapitan
kapitan
ImportError: failed to find libmagic. Check your installation
kapitan -v
Traceback (most recent call last):
File "/root/.local/bin/kapitan", line 5, in<module>
from kapitan.cli import main
File "/root/.local/lib/python3.11/site-packages/kapitan/cli.py", line 23, in<module>
from kapitan.inputs.jsonnet import jsonnet_file
File "/root/.local/lib/python3.11/site-packages/kapitan/inputs/jsonnet.py", line 14, in<module>
from kapitan.inputs.base import CompiledFile, InputType
File "/root/.local/lib/python3.11/site-packages/kapitan/inputs/base.py", line 19, in<module>
from kapitan.refs.base import Revealer
File "/root/.local/lib/python3.11/site-packages/kapitan/refs/base.py", line 23, in<module>
from kapitan.utils import PrettyDumper, list_all_paths
File "/root/.local/lib/python3.11/site-packages/kapitan/utils.py", line 12, in<module>
import magic
File "/root/.local/lib/python3.11/site-packages/magic/__init__.py", line 209, in<module>
libmagic = loader.load_lib()
^^^^^^^^^^^^^^^^^
File "/root/.local/lib/python3.11/site-packages/magic/loader.py", line 49, in load_lib
raise ImportError('failed to find libmagic. Check your installation')
ImportError: failed to find libmagic. Check your installation
/ #
The text was updated successfully, but these errors were encountered:
Reopening again, because the fix was reverted, and it shouldn't be the case to have kapitan not working after installing the dependencies. Also you shouldn't have to install specific dependencies manually afterwards...
This issue is stale because it has been open for 1 year with no activity.
Remove the stale label or comment if this issue is still relevant for you.
If not, please close it yourself.
Description of the bug
If libmagic is not installed you get an
ImportError
,I think it should be reported some other way, preferibably it should say that it's missing at
pip install
time. Or preferably install it automatically somehow.I see that there was some work for that but it doesn seem to work on alpine at least , see the steps to reproduce below
Steps to reproduce
docker run --rm -ti alpine:3.18 apk add git gettext helm curl python3 python3-dev py3-pip make g++ go python -m venv kapitan-venv source kapitan-venv/bin/activate pip install -U pip pip install -U kapitan kapitan ImportError: failed to find libmagic. Check your installation
Then if I manually install
libmagic
it works:What happened?
I got an ImportError because libmagic is missing.
I would expect an error at
pip install
time not a runtime. Or mention in the documentation.Additional context
#952
#951
Version (kapitan)
v0.31.0 (stable)
Version (kapitan)
I use kapitan directly (pip, docker)
Python virtual environment
OS information
Alpine 3.18
Relevant log output
The text was updated successfully, but these errors were encountered: