pythonmacospiphomebrew

No module named cairo even though cairo is already installed- Mac


I've been trying to run a text-to-handwriting ai called "My Text in Your Handwriting" on my intel Mac. https://github.com/thaines/helit/tree/master/handwriting

Going through the install process and ran into a problem

Traceback (most recent call last):
  File "image_viewer.py", line 17, in <module>
    from viewer import *
  File "/*My home Folder*/helit/utils_gui/viewer.py", line 15, in <module>
    import cairo
ImportError: No module named cairo

I have ran into several of these kinds of problems with a missing module, but I have usually just installed the required modules with brew install *module* however, when I try brew install cairo it just tells me that it's already installed.

I have ran into several of these kinds of problems with a missing module, but I have usually just installed the required modules with brew install *module* however, when I try brew install cairo it just tells me that it's already installed. Do I not have the right version for this certain app? Am I missing something? I will admit I am very new to having to manually install python dependencies. I'm used to just installing with one command. Let me know what you think, and thanks for your time.


Solution

  • That's missing a Python module; those aren't provided by Homebrew's brew.

    import cairo would be provided by Pycairo, so (with a virtualenv activated for your project) try pip install pycairo to install that module.