Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ImportError: No module named 'fontforge' #3

Closed
ncraun opened this issue Sep 21, 2013 · 4 comments
Closed

ImportError: No module named 'fontforge' #3

ncraun opened this issue Sep 21, 2013 · 4 comments

Comments

@ncraun
Copy link
Owner

ncraun commented Sep 21, 2013

Split from arthurtiteica's original issue report:

With python3 the problem goes as

Traceback (most recent call last):
  File "/usr/bin/smoothscan-fontgen.py", line 23, in <module>
    import fontforge
ImportError: No module named 'fontforge'

I'm using
python 3.3.2-2
fontforge 20120731_b-6
libharu 2.2.1-4
potrace 1.11-1
leptonica 1.69-8

@ncraun
Copy link
Owner Author

ncraun commented Sep 21, 2013

This error is commonly caused when using a version of fontforge which was compiled without python support. Smoothscan uses the python interface to call fontforge and generate the fonts, so if fontforge is compiled without python support, smoothscan won't work. There are some prebuilt versions of fontforge online that were compiled without python support, so if you are seeing this issue double check that your copy was built with python support, and if not rebuild it with python support. For more information on how to do this, check out this page: http://fontforge.org/python.html#extension

However, in this specific case the problem was with python 3. I was able to find this bit of info from the fontforge developers: fontforge/fontforge#109 indicating that you can compile fontforge to work with python 2 or python 3 but not both. Which one you use will depend on which version your copy of fontforge is built against.

@ncraun ncraun closed this as completed Sep 21, 2013
@ncraun ncraun reopened this Sep 21, 2013
@zcater
Copy link

zcater commented Sep 21, 2013

I see. In this case I should use python2 then as fontforge is built with it.

Thanks for the input.

@ncraun ncraun closed this as completed Sep 21, 2013
@ncraun
Copy link
Owner Author

ncraun commented Sep 23, 2013

I modified the configure script to check what version of python fontforge was built against, and generate the python interface script to use that same version. It will also produce an error if it detects that fontforge was built without python support.

SHA: 0fe04ed

@zcater
Copy link

zcater commented Sep 23, 2013

Thanks. I confirm it correctly detects python2 in my case.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants