Visitar URL original
Fix-nonhinting produces ImportError: cannot import name 'parse' from 'gflanguages' · Issue #1075 · googlefonts/gftools · GitHub
Skip to content

Fix-nonhinting produces ImportError: cannot import name 'parse' from 'gflanguages' #1075

Open

Description

@kosbarts

Hi, I am trying to run fix-nonhinting on a variable font and I am getting the following error:

Traceback (most recent call last):
File "/Users/kostas/Google_Drive_hi@kostasbartsokas.com/Foundry5_Fonts/Peridot/venv/bin/gftools", line 8, in
sys.exit(main())
File "/Users/kostas/Google_Drive_hi@kostasbartsokas.com/Foundry5_Fonts/Peridot/venv/lib/python3.9/site-packages/gftools/scripts/init.py", line 97, in main
mod = import_module(f".{module}", package)
File "/usr/local/Cellar/python@3.9/3.9.7_1/Frameworks/Python.framework/Versions/3.9/lib/python3.9/importlib/init.py", line 127, in import_module
return _bootstrap._gcd_import(name[level:], package, level)
File "", line 1030, in _gcd_import
File "", line 1007, in _find_and_load
File "", line 986, in _find_and_load_unlocked
File "", line 680, in _load_unlocked
File "", line 850, in exec_module
File "", line 228, in _call_with_frames_removed
File "/Users/kostas/Google_Drive_hi@kostasbartsokas.com/Foundry5_Fonts/Peridot/venv/lib/python3.9/site-packages/gftools/scripts/fix_nonhinting.py", line 53, in
from gftools.fix import fix_unhinted_font
File "/Users/kostas/Google_Drive_hi@kostasbartsokas.com/Foundry5_Fonts/Peridot/venv/lib/python3.9/site-packages/gftools/fix.py", line 15, in
from gftools.util.google_fonts import _KNOWN_WEIGHTS
File "/Users/kostas/Google_Drive_hi@kostasbartsokas.com/Foundry5_Fonts/Peridot/venv/lib/python3.9/site-packages/gftools/util/google_fonts.py", line 41, in
from gflanguages import LoadLanguages, parse
ImportError: cannot import name 'parse' from 'gflanguages' (/Users/kostas/Google_Drive_hi@kostasbartsokas.com/Foundry5_Fonts/Peridot/venv/lib/python3.9/site-packages/gflanguages/init.py)

Any ideas what is causing it?
I am running gftools 0.9.77.dev10+gb025165 and I haven't had issues with previous versions.

Activity

  1. simoncozens commented on Jan 15, 2025

    @simoncozens
    Contributor

    Make sure you have gflanguages>=0.7.0; we added the parse function about a year ago!

  2. kosbarts commented on Jan 15, 2025

    @kosbarts
    Author

    How do I install it? Isn't it part of gfttools?

    I ran pip install -U gflanguages and I got this:
    Requirement already satisfied: gflanguages in /Users/kostas/Google_Drive_hi@kostasbartsokas.com/Foundry5_Fonts/Peridot/venv/lib/python3.9/site-packages (0.8.9)
    Requirement already satisfied: protobuf<4,>=3.7.0 in /Users/kostas/Google_Drive_hi@kostasbartsokas.com/Foundry5_Fonts/Peridot/venv/lib/python3.9/site-packages (from gflanguages) (3.20.3)

  3. simoncozens commented on Jan 15, 2025

    @simoncozens
    Contributor

    Requirement already satisfied: gflanguages ... (0.8.9)

    Ah, OK, this version was released by mistake with a bad version number and then soon yanked afterwards. Looks like you installed things at a very unlucky time. If you have gflanguages in your requirements.txt, remove it. Then delete your venv and recreate it.

  4. kosbarts commented on Jan 15, 2025

    @kosbarts
    Author

    I just updated the venv today! How unlucky was I?!

    Thanks so much. I'll delete and recreate it.

  5. kosbarts commented on Jan 15, 2025

    @kosbarts
    Author

    I can't install nothing on a new venv. Getting this stupid message:
    ...
    xcrun: error: invalid active developer path (/Library/Developer/CommandLineTools), missing xcrun at: /Library/Developer/CommandLineTools/usr/bin/xcrun
    error: command '/usr/bin/clang' failed with exit code 1
    [end of output]

    note: This error originates from a subprocess, and is likely not a problem with pip.
    ERROR: Failed building wheel for cmarkgfm
    Failed to build cmarkgfm
    ERROR: ERROR: Failed to build installable wheels for some pyproject.toml based projects (cmarkgfm)

  6. simoncozens commented on Jan 15, 2025

    @simoncozens
    Contributor

    Google has lots of results for that error message. :-) Try running xcode-select --install.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions