huertatipografica / HTLetterspacer

HT Letterspacer is a tool for spacing fonts
https://huertatipografica.github.io/HTLetterspacer/
GNU General Public License v3.0
73 stars 16 forks source link

cannot import name redirect_stderr #50

Closed soundbo closed 5 years ago

soundbo commented 5 years ago

So after playing and starting some typefaces, i did installed HTLetterspacer for testing purpose. it worked fine, i thought it made some good adjustments to my spacing, then worked a lot on the font. add a second master, and thought it was time to use HTL again.

but it doesnt run anymore i get this in the macro window :

Start
Traceback (most recent call last):
  File "HT_LetterSpacer.py", line 8, in <module>
    import HT_LetterSpacer_script
  File "HT_LetterSpacer_script.py", line 22, in <module>
    from objectsGS import *
  File "GlyphsApp/objectsGS.py", line 12, in <module>
  File "ufoLib.py", line 38, in <module>
    from robofab.glifLib import GlyphSet, READ_MODE, WRITE_MODE
  File "glifLib.py", line 19, in <module>
    from robofab.pens.pointPen import AbstractPointPen
  File "pointPen.py", line 145, in <module>
    from fontTools.pens.basePen import AbstractPen
  File "__init__.py", line 1, in <module>
    from fontTools.misc.py23 import *
  File "__init__.py", line 3, in <module>
    from fontTools.misc.py23 import *
  File "py23.py", line 6, in <module>
    from contextlib import redirect_stderr, redirect_stdout
ImportError: cannot import name redirect_stderr
End

im using latest glyphs Version 2.6.1 (1230) even with the example font i got no luck

soundbo commented 5 years ago

seems to be related to te latest fonttools package, because after replacing it with the fonttools-3.21.1 it works again.

anthrotype commented 5 years ago

@soundbo I believe you are using the latest fonttools from the Github repository, which is now only compatible with python3.6 or above. The problem is the Glyphs.app's embedded python interpreter is still using python2.7, so this means Glyphs.app will no longer be compatible with new versions of fonttools, until the app is updated to ship with a modern python 3 version.

/cc @schriftgestalt

anthrotype commented 5 years ago

FYI, the last version of fonttools that is compatible with python2.7 is https://github.com/fonttools/fonttools/releases/tag/3.44.0

schriftgestalt commented 5 years ago

Thanks. As I read this, I suspected that this could be the problem. I changed the download URL.

soundbo commented 5 years ago

Thanks. As I read this, I suspected that this could be the problem. I changed the download URL.

Hi Georg, does this means that when we update the modules in prefs, it will DL the fonttools 3.44.0 by default ?

@soundbo I believe you are using the latest fonttools from the Github repository, which is now only compatible with python3.6 or above. The problem is the Glyphs.app's embedded python interpreter is still using python2.7, so this means Glyphs.app will no longer be compatible with new versions of fonttools, until the app is updated to ship with a modern python 3 version.

/cc @schriftgestalt

Thank you anthrotype, this explains everything.

schriftgestalt commented 5 years ago

Yes. With the next update it will download the right version.

soundbo commented 5 years ago

nice, ty Georg and everyone else for their infos and advices

juandelperal commented 5 years ago

Thanks!