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

Plog exception running pyenchant on QGIS windows 10 #1

Closed
walking-the-talk opened this issue Jan 13, 2024 · 2 comments
Closed

Plog exception running pyenchant on QGIS windows 10 #1

walking-the-talk opened this issue Jan 13, 2024 · 2 comments

Comments

@walking-the-talk
Copy link

Whilst testing pyenchant for QGIS on Windows 10 using Puentes I received this Python Log error:

              File "C:\Users/Chris/AppData/Roaming/QGIS/QGIS3\profiles\default/python/plugins\puentes\plugin.py", line 94, in run_command
              runpy.run_path(self.file_path, init_globals={'plog': plog})
              File "C:\PROGRA~1\QGIS32~1.2\apps\Python39\lib\runpy.py", line 268, in run_path
              return _run_module_code(code, init_globals, run_name,
              File "C:\PROGRA~1\QGIS32~1.2\apps\Python39\lib\runpy.py", line 97, in _run_module_code
              _run_code(code, mod_globals, init_globals,
              File "C:\PROGRA~1\QGIS32~1.2\apps\Python39\lib\runpy.py", line 87, in _run_code
              exec(code, run_globals)
              File "C:\Users\Chris\AppData\Roaming\QGIS\QGIS3\profiles\default\python\expressions\test_enchant.py", line 8, in 
              d = enchant.Dict("en_US")
              File "C:\Users\Chris\AppData\Roaming\Python\Python39\site-packages\enchant\__init__.py", line 542, in __init__
              super().__init__()
              File "C:\Users\Chris\AppData\Roaming\Python\Python39\site-packages\enchant\__init__.py", line 144, in __init__
              self._init_this()
              File "C:\Users\Chris\AppData\Roaming\Python\Python39\site-packages\enchant\__init__.py", line 549, in _init_this
              this = self._broker._request_dict_data(self.tag)
              File "C:\Users\Chris\AppData\Roaming\Python\Python39\site-packages\enchant\__init__.py", line 287, in _request_dict_data
              self._raise_error(e_str % (tag,), DictNotFoundError)
              File "C:\Users\Chris\AppData\Roaming\Python\Python39\site-packages\enchant\__init__.py", line 233, in _raise_error
              raise eclass(default)
             enchant.errors.DictNotFoundError: Dictionary for language 'en_US' could not be found
             Please check https://pyenchant.github.io/pyenchant/ for details
             
             During handling of the above exception, another exception occurred:
             
             Traceback (most recent call last):
              File "C:\Users/Chris/AppData/Roaming/QGIS/QGIS3\profiles\default/python/plugins\puentes\plugin.py", line 98, in run_command
              plog(*traceback.format_exception(e, limit=-1))
             TypeError: format_exception() missing 2 required positional arguments: 'value' and 'tb'

Tested on QGIS version 3.22.2 and 3.34.1, both with Python version 3.9.5

Many thanks for pointing me in the direction of this plug-in and for your assistance with trying to get pyenchant working.

@caprieldeluca
Copy link
Owner

Thank you very much.

I commited changes today, to allow bacwards compatibility for Python < 3.10.

I also sen't the new code as version 1.0.1 to QGIS Plugins repository, but it can take some days to be approved.

If you can, clone the repository and compress the puentes folder, or download as zip, and install from zip file in QGIS.

@walking-the-talk
Copy link
Author

Perfect, thanks - I have cloned, zipped, installed and tested. It now works as you expect (the additional exception no longer occurs).

That was VERY fast work! Much appreciated.

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