You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
from constituent_treelib import ConstituentTree, Language
many package which I don't need are imported. This is problematic for Python environments where tkinter is not available, such as when the Python interpreter is provisioned by pyenv or by uv, as is increasingly common. In fact, the above import fails in such environments with,
from constituent_treelib import ConstituentTree, Language
/Users/rjs/.virtualenvs/demonstrable-codex/lib/python3.11/site-packages/constituent_treelib/__init__.py:3: in <module>
from constituent_treelib.core import *
/Users/rjs/.virtualenvs/demonstrable-codex/lib/python3.11/site-packages/constituent_treelib/core.py:17: in <module>
from .export import export_figure
/Users/rjs/.virtualenvs/demonstrable-codex/lib/python3.11/site-packages/constituent_treelib/export.py:8: in <module>
from nltk.draw.tree import TreeView
/Users/rjs/.virtualenvs/demonstrable-codex/lib/python3.11/site-packages/nltk/draw/tree.py:12: in <module>
from tkinter import IntVar, Menu, Tk
/Users/rjs/.pyenv/versions/3.11.4/lib/python3.11/tkinter/__init__.py:38: in <module>
import _tkinter # If this fails your Python may not be configured for Tk
E ModuleNotFoundError: No module named '_tkinter'
I solved this, by modifying my installation of Constituent-TreeLib by removing from .export import export_figure from core.py. Now my program works, and I can use your otherwise excellent library successfully.
Please consider making default imports less onerous. We can import the visualisation code if we need it.
The text was updated successfully, but these errors were encountered:
If I perform a basic import such as,
many package which I don't need are imported. This is problematic for Python environments where
tkinter
is not available, such as when the Python interpreter is provisioned bypyenv
or byuv
, as is increasingly common. In fact, the above import fails in such environments with,I solved this, by modifying my installation of Constituent-TreeLib by removing
from .export import export_figure
fromcore.py
. Now my program works, and I can use your otherwise excellent library successfully.Please consider making default imports less onerous. We can import the visualisation code if we need it.
The text was updated successfully, but these errors were encountered: