question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

ModuleNotFoundError: No module named 'fontforge'

See original GitHub issue

Observed behaviour

When I try to install FontBakery, I get the following error:

Collecting fontbakery (from -r requirements.txt (line 8))
  Using cached https://files.pythonhosted.org/packages/a6/19/07b7166d7ff8f95a7beb41ae533a23c283a539f771b0baad0f9983adea04/fontbakery-0.0.13.tar.gz
    ERROR: Complete output from command python setup.py egg_info:
    ERROR: Traceback (most recent call last):
      File "/private/var/folders/sr/fzxs628x5gbgjtwscngjdcqh0000gn/T/pip-install-gt4owhmn/fontbakery/setup.py", line 25, in <module>
        import fontforge
    ModuleNotFoundError: No module named 'fontforge'
    
    During handling of the above exception, another exception occurred:
    
    Traceback (most recent call last):
      File "<string>", line 1, in <module>
      File "/private/var/folders/sr/fzxs628x5gbgjtwscngjdcqh0000gn/T/pip-install-gt4owhmn/fontbakery/setup.py", line 27, in <module>
        raise Exception(msg)
    Exception: Python module `fontforge` is required. Install it with `apt-get install python-fontforge` or `brew install python; brew install fontforge --HEAD`
    ----------------------------------------
ERROR: Command "python setup.py egg_info" failed with error code 1 in /private/var/folders/sr/fzxs628x5gbgjtwscngjdcqh0000gn/T/pip-install-gt4owhmn/fontbakery/

So, I ran:

▶ brew install python; brew install fontforge --HEAD
Warning: python 3.7.3 is already installed and up-to-date
To reinstall 3.7.3, run `brew reinstall python`
Warning: fontforge  is already installed
The currently linked version is 20190413
You can use `brew switch fontforge ` to link this version.

Then

▶ brew switch fontforge 20190413
Cleaning /usr/local/Cellar/fontforge/20190413
55 links created for /usr/local/Cellar/fontforge/20190413

But I ended up with the same error as before.

Expected behaviour

I expect FontBakery to install without this error, because I have already install fontforge, as homebrew confirms.

Resources and exact process needed to replicate

Encode Sans at https://github.com/thundernixon/Encode-Sans/tree/4c0afcc9e79bd91238ebb4a834516b93fa128d7b

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:18 (13 by maintainers)

github_iconTop GitHub Comments

3reactions
laerm0commented, May 10, 2019

https://stackoverflow.com/a/17153977 :

You can get pip to give verbose output using the -v flag … but one isn’t enough. I RTFM-ed the help, which said you can do -v multiple times, up to 3x, for more verbose output.

This is, hands down, one of the stupidest things I’ve ever read.

2reactions
chrissimpkinscommented, May 10, 2019

I think that this may be due to the fact that the Python fontforge module is coming from a brew install of fontforge command line tools (not from pip3 where it doesn’t exist/is not distributed). Looking at the Homebrew Ruby formula for fontforge, it seems that the Python module that it installs is Py2 only. Your Py3 venv can’t import it. The old FB version doesn’t handle the fontforge import exception and chokes…

I think 😃

Read more comments on GitHub >

github_iconTop Results From Across the Web

ImportError: No module named fontforge · Issue #2597 - GitHub
FontForge is a compiled program, not a python script or module, so it makes sense that python does not know what it is,...
Read more >
Pip install fontforge, says Couldnot find a version
When i do import fontforge in my python code, it throws error as, No module named fontforge . When i do, pip install...
Read more >
Python Scripting — FontForge 20220308 documentation
FontForge implements two Python modules – one great huge one called fontforge which provides access to as much of FontForge's functionality as I've...
Read more >
install ubuntu (python3) : No module named 'fontforge'
install ubuntu (python3) : No module named 'fontforge' ... when I import fontforge, it can't find the fontforge module. is there any installation ......
Read more >
[solved]python pip no longer installing packages
... import main ModuleNotFoundError: No module named 'pip' ... ceph-libs checkmails cuda fio fontforge fwupd gdb gdb-common glusterfs gwe ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found