Skip to content

Installation fails on macOS due to missing libmagic dependency #2

@FrederikKli

Description

@FrederikKli

Hi there,

I encountered an issue while trying to install and run CntxtJV on macOS. Following the instructions in the Quick Start section, I cloned the repository and installed the package using pip3. However, upon running the code, I received the following error:

Error importing regex components: failed to find libmagic. Check your installation
Make sure all component files are in the 'regex_components' directory

System Info:

OS: macOS Sequoia 15.6
Python: 3.13.5
Installation method: Cloned repo + pip3 install .

Diagnosis:

After some investigation, I found that the issue was due to a missing libmagic dependency, which is required by the package but not mentioned in the installation instructions. I resolved the issue by installing libmagic via Homebrew:
brew install libmagic

This requirement is mentioned on the python-magic GitHub page, but it would be helpful if CntxtJV either:

  • Included a note in the README about this dependency for macOS users, or
  • Provided an alternative installation method that ensures libmagic is available (e.g., via pyproject.toml or setup.py extras)

Expected Behavior:

I expected the package to work out of the box after following the Quick Start instructions, without requiring additional system-level dependencies.

Let me know if you'd like me to submit a PR updating the README with this info!

Thanks for your work on this project!

Where this is mentioned:

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions