Open JD-Veiga opened 9 months ago
I have (painfully) upgraded enchant
C library to 2.6.2 (latest) and got the same bug.
enchant
library compiles but fails tests in macOS 10.15. However, it runs smoothly when invoked from terminal (is this alarming?). [The same happens with enchant
2.3.4]
On the contrary, pyenchant
running on Python 3.12 and calling enchant 2.6.2
does not work (as it does not when calling enchant
2.3.4). Intriguingly, pyenchant
works when it is used from Python 3.11. That is just the same behaviour with previous version enchant
2.3.4.
I must say that enchant
2.3.4 also fails tests when compiled in macOS 10.15. Does it means that the bug is not buried in enchant library but in Python itself --something Python ABI-related, maybe?
I can't use pyenchant under 3.12 on macOS 14.3.1 23D60 arm64.
Python 3.12.2 (main, Feb 27 2024, 08:43:18) [Clang 15.0.0 (clang-1500.1.0.2.5)]
Type 'copyright', 'credits' or 'license' for more information
IPython 8.22.1 -- An enhanced Interactive Python. Type '?' for help.
In [1]: from enchant import Dict
---------------------------------------------------------------------------
ImportError Traceback (most recent call last)
Cell In[1], line 1
----> 1 from enchant import Dict
ImportError: cannot import name 'Dict' from 'enchant' (/Users/reagle/.pyenv/versions/3.12.2/lib/python3.12/site-packages/enchant/__init__.py)
Hi, @reagle:
I think that your problem is different from mine.
Are you sure that enchant
is properly installed? Dict
class is defined in enchant/__init__.py
and should be imported without any major problem (I can import it without any issue).
You can check /Users/reagle/.pyenv/versions/3.12.2/lib/python3.12/site-packages/enchant/__init__.py
and search for "class Dict". It must be there (it have been there for ages, according to github).
Which version of pyenchant
are you running?
@JD-Veiga, I'm on macOS 14.4 23E214 arm64
and my __init__.py
is empty.
total 40K
-rw-r--r-- 1 reagle staff 0 Feb 27 08:44 __init__.py
-rw-r--r-- 1 reagle staff 12K Feb 27 08:44 _enchant.py
drwxr-xr-x 6 reagle staff 192 Feb 27 08:44 checker/
-rw-r--r-- 1 reagle staff 2.1K Feb 27 08:44 errors.py
-rw-r--r-- 1 reagle staff 245 Feb 27 08:44 messenger.py
-rw-r--r-- 1 reagle staff 9.0K Feb 27 08:44 pypwl.py
drwxr-xr-x 4 reagle staff 128 Feb 27 08:44 tokenize/
-rw-r--r-- 1 reagle staff 4.2K Feb 27 08:44 utils.py
==> enchant: stable 2.6.7 (bottled)
Spellchecker wrapping library
https://abiword.github.io/enchant/
/opt/homebrew/Cellar/enchant/2.6.7 (29 files, 488.5KB) *
Poured from bottle using the formulae.brew.sh API on 2024-02-09 at 08:28:21
From: https://github.com/Homebrew/homebrew-core/blob/HEAD/Formula/e/enchant.rb
License: LGPL-2.1-or-later
==> Dependencies
Build: pkg-config
Required: aspell, glib
==> Analytics
install: 2,997 (30 days), 10,691 (90 days), 32,353 (365 days)
install-on-request: 1,689 (30 days), 5,715 (90 days), 17,135 (365 days)
build-error: 0 (30 days)
Name: pyenchant
Version: 3.2.2
Summary: Python bindings for the Enchant spellchecking system
Home-page: https://pyenchant.github.io/pyenchant/
Author: Dimitri Merejkowsky
Author-email: d.merej@gmail.com
License: LGPL
Location: /Users/reagle/.pyenv/versions/3.12.2/lib/python3.12/site-packages
Requires:
Required-by:
I think that it must not be empty whichever the system or version of pyenchant. Probably the installation has failed at some point.
From your output, I guess that you are using pyenv
. I cannot provide any useful help on pyenv since I rather use it.
I can only suggest to re-install pyenchant. In my case, since I use pip
, running pip uninstall pyenchant; pip install pyenchant
should do the job.
I do not really know if there are specific commands in pyenv for doing this particular task, sorry. I suppose that you can simply run pip commands in the virtual environment, but I am not sure at all.
I have tried pyenchat
in Python 3.13.0a5 and it still causes a Abort trap: 6
error .
macOS 10.15.7 (19H2026) Python 3.13.0a5 pyenchant 3.2.2 enchant 1.6.0 enchant2 2.6.7
Still happens en Python 3.12.3
Python 3.13.0a6 still has this bug.
Hello,
pyenchant
fails when run in Python 3.12 on a macOS 10.15 system. I have tested pyenchant 3.2.2 and 3.3.0rc1 and both versions fail under Python 3.12. They run well under Python 3.11.Failure can be check with one-line command:
python3.12 -c "import enchant; broker = enchant.Broker(); print(broker.describe()); print(broker.list_languages())"
which causes aAbort trap: 6
error message whenbroker.describe
is run.The enchant library version is 2.3.4 (however, I do not think this is the cause of the bug).
Running tests outputs the following information:
Thank you.