ModuleNotFoundError: No module named 'fontforge'
See original GitHub issueObserved 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:
- Created 4 years ago
- Comments:18 (13 by maintainers)
Top 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 >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
https://stackoverflow.com/a/17153977 :
This is, hands down, one of the stupidest things I’ve ever read.
I think that this may be due to the fact that the Python
fontforge
module is coming from abrew 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 😃