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

Exception in Tkinter callback / ImportError: DLL load failed: The specified module could not be found #261

Closed
shahram7 opened this issue Nov 3, 2020 · 8 comments

Comments

@shahram7
Copy link

shahram7 commented Nov 3, 2020

Hi Saeed and everyone who reads this
I would convert my dictionary, which is in Stardict format, to a format readable by Python. (I am going to create Anki flashcards later using python.)
First of all I would ask, to which format should I write my dictionary. I just don't want the HTML formatting (Color, Bold, Italic, New lines) of my dictionary to be deleted.

I have tried to convert my dictionary from stardict Format to FreeDict format, but I did not succeed.

Best wishes

[ERROR] Exception in Tkinter callback:
Traceback (most recent call last):
  File "C:\Users\Shahram\PycharmProjects\FlashCards\FlashCards\pyglossary\pyglossary\ui\ui_tk.py", line 192, in CallWrapper__call__
    return self.func(*args)
  File "C:\Users\Shahram\PycharmProjects\FlashCards\FlashCards\pyglossary\pyglossary\ui\ui_tk.py", line 1092, in convert
    **self._convertOptions
  File "C:\Users\Shahram\PycharmProjects\FlashCards\FlashCards\pyglossary\pyglossary\glossary.py", line 1268, in convert
    **readOptions
  File "C:\Users\Shahram\PycharmProjects\FlashCards\FlashCards\pyglossary\pyglossary\glossary.py", line 811, in read
    reader = self._createReader(format, options)
  File "C:\Users\Shahram\PycharmProjects\FlashCards\FlashCards\pyglossary\pyglossary\glossary.py", line 702, in _createReader
    reader = self.plugins[format].readerClass(self)
  File "C:\Users\Shahram\PycharmProjects\FlashCards\FlashCards\pyglossary\pyglossary\plugins\stardict.py", line 130, in __init__
    self._xdxf_tr = xdxf_to_html_transformer()
  File "C:\Users\Shahram\PycharmProjects\FlashCards\FlashCards\pyglossary\pyglossary\xdxf_transform.py", line 7, in xdxf_to_html_transformer
    from lxml import etree
ImportError: DLL load failed: The specified module could not be found.
Traceback (most recent call last):
  File "C:\Users\Shahram\PycharmProjects\FlashCards\FlashCards\pyglossary\pyglossary\ui\ui_tk.py", line 192, in CallWrapper__call__
    return self.func(*args)
  File "C:\Users\Shahram\PycharmProjects\FlashCards\FlashCards\pyglossary\pyglossary\ui\ui_tk.py", line 1092, in convert
    **self._convertOptions
  File "C:\Users\Shahram\PycharmProjects\FlashCards\FlashCards\pyglossary\pyglossary\glossary.py", line 1268, in convert
    **readOptions
  File "C:\Users\Shahram\PycharmProjects\FlashCards\FlashCards\pyglossary\pyglossary\glossary.py", line 811, in read
    reader = self._createReader(format, options)
  File "C:\Users\Shahram\PycharmProjects\FlashCards\FlashCards\pyglossary\pyglossary\glossary.py", line 702, in _createReader
    reader = self.plugins[format].readerClass(self)
  File "C:\Users\Shahram\PycharmProjects\FlashCards\FlashCards\pyglossary\pyglossary\plugins\stardict.py", line 130, in __init__
    self._xdxf_tr = xdxf_to_html_transformer()
  File "C:\Users\Shahram\PycharmProjects\FlashCards\FlashCards\pyglossary\pyglossary\xdxf_transform.py", line 7, in xdxf_to_html_transformer
    from lxml import etree
ImportError: DLL load failed: The specified module could not be found.
@ilius
Copy link
Owner

ilius commented Nov 3, 2020

Please run pip3 install lxml --user command and try again:

@ilius
Copy link
Owner

ilius commented Nov 3, 2020

You can convert to Tabfile(txt), CSV or JSON formats, all easy to parse.

@shahram7
Copy link
Author

shahram7 commented Nov 3, 2020

Hi again Saeed and thanks a lot for your fast response,

Please run pip3 install lxml --user command and try again:
ive run that:

C:\Users\Shahram\PycharmProjects\FlashCards\FlashCards\pyglossary>pip install lxml
Requirement already satisfied: lxml in c:\users\shahram\anaconda3\lib\site-packages (4.5.1)

but i cant still use the pyglossary

Console:
[INFO] Invalid language code/name 'Duden' in match=('Duden', '-', 'Das')
[INFO] Invalid language code/name 'Ge' in match=('Ge', '-', 'Ge')
[INFO] Failed to detect sourceLang and targetLang from glossary name 'Duden - Das große Wörterbuch der deutschen Sprache (Ge-Ge)'

[INFO] Writing to FreeDict file 'C:\\Users\\Shahram\\PycharmProjects\\FlashCards\\Anki Dictionaries\\output\\freedict.tei'
[INFO] Using Reader class from Stardict plugin for direct conversion without loading into memory
[ERROR] Exception while calling plugin's write function
Traceback (most recent call last):
  File "C:\Users\Shahram\PycharmProjects\FlashCards\FlashCards\pyglossary\pyglossary\glossary.py", line 1182, in write
    for entry in self:
  File "C:\Users\Shahram\PycharmProjects\FlashCards\FlashCards\pyglossary\pyglossary\glossary.py", line 421, in _readersEntryGen
    for index, entry in enumerate(self._applyEntryFiltersGen(reader)):
  File "C:\Users\Shahram\PycharmProjects\FlashCards\FlashCards\pyglossary\pyglossary\glossary.py", line 433, in _applyEntryFiltersGen
    for index, entry in enumerate(gen):
  File "C:\Users\Shahram\PycharmProjects\FlashCards\FlashCards\pyglossary\pyglossary\plugins\stardict.py", line 306, in __iter__
    partDefi = self.xdxf_transform(partDefi)
  File "C:\Users\Shahram\PycharmProjects\FlashCards\FlashCards\pyglossary\pyglossary\plugins\stardict.py", line 153, in xdxf_transform
    self.xdxf_setup()
  File "C:\Users\Shahram\PycharmProjects\FlashCards\FlashCards\pyglossary\pyglossary\plugins\stardict.py", line 149, in xdxf_setup
    self._xdxf_tr = xdxf_to_html_transformer()
  File "C:\Users\Shahram\PycharmProjects\FlashCards\FlashCards\pyglossary\pyglossary\xdxf_transform.py", line 7, in xdxf_to_html_transformer
    from lxml import etree
ImportError: DLL load failed: The specified module could not be found.
Traceback (most recent call last):
  File "C:\Users\Shahram\PycharmProjects\FlashCards\FlashCards\pyglossary\pyglossary\glossary.py", line 1182, in write
    for entry in self:
  File "C:\Users\Shahram\PycharmProjects\FlashCards\FlashCards\pyglossary\pyglossary\glossary.py", line 421, in _readersEntryGen
    for index, entry in enumerate(self._applyEntryFiltersGen(reader)):
  File "C:\Users\Shahram\PycharmProjects\FlashCards\FlashCards\pyglossary\pyglossary\glossary.py", line 433, in _applyEntryFiltersGen
    for index, entry in enumerate(gen):
  File "C:\Users\Shahram\PycharmProjects\FlashCards\FlashCards\pyglossary\pyglossary\plugins\stardict.py", line 306, in __iter__
    partDefi = self.xdxf_transform(partDefi)
  File "C:\Users\Shahram\PycharmProjects\FlashCards\FlashCards\pyglossary\pyglossary\plugins\stardict.py", line 153, in xdxf_transform
    self.xdxf_setup()
  File "C:\Users\Shahram\PycharmProjects\FlashCards\FlashCards\pyglossary\pyglossary\plugins\stardict.py", line 149, in xdxf_setup
    self._xdxf_tr = xdxf_to_html_transformer()
  File "C:\Users\Shahram\PycharmProjects\FlashCards\FlashCards\pyglossary\pyglossary\xdxf_transform.py", line 7, in xdxf_to_html_transformer
    from lxml import etree
ImportError: DLL load failed: The specified module could not be found.


[ERROR] Writing file 'C:/Users/Shahram/PycharmProjects/FlashCards/Anki Dictionaries/output/freedict.tei' failed.

@ilius
Copy link
Owner

ilius commented Nov 3, 2020

Please try again with the latest code.

@shahram7
Copy link
Author

shahram7 commented Nov 3, 2020

Please try again with the latest code.

Many thanks for your time and effort. I still get this error message

Console:
[WARNING] unknown config key 'noProgressBar', you may edit C:\Users\Shahram\AppData\Roaming\PyGlossary\config.json file and remove this key
[WARNING] unknown config key 'ui_autoSetOutputFileName', you may edit C:\Users\Shahram\AppData\Roaming\PyGlossary\config.json file and remove this key
[WARNING] unknown config key 'utf8Check', you may edit C:\Users\Shahram\AppData\Roaming\PyGlossary\config.json file and remove this key
[INFO] Invalid language code/name 'Duden' in match=('Duden', '-', 'Das')
[INFO] Invalid language code/name 'Ge' in match=('Ge', '-', 'Ge')
[INFO] Failed to detect sourceLang and targetLang from glossary name 'Duden - Das große Wörterbuch der deutschen Sprache (Ge-Ge)'

[INFO] Writing to FreeDict file 'C:\\Users\\Shahram\\PycharmProjects\\FlashCards\\Anki Dictionaries\\output\\freedict.tei'
[INFO] Using Reader class from Stardict plugin for direct conversion without loading into memory
[ERROR] Exception while calling plugin's write function
Traceback (most recent call last):
  File "C:\Users\Shahram\PycharmProjects\FlashCards\FlashCards\pyglossary\pyglossary\glossary.py", line 1182, in write
    for entry in self:
  File "C:\Users\Shahram\PycharmProjects\FlashCards\FlashCards\pyglossary\pyglossary\glossary.py", line 421, in _readersEntryGen
    for index, entry in enumerate(self._applyEntryFiltersGen(reader)):
  File "C:\Users\Shahram\PycharmProjects\FlashCards\FlashCards\pyglossary\pyglossary\glossary.py", line 433, in _applyEntryFiltersGen
    for index, entry in enumerate(gen):
  File "C:\Users\Shahram\PycharmProjects\FlashCards\FlashCards\pyglossary\pyglossary\plugins\stardict.py", line 306, in __iter__
    partDefi = self.xdxf_transform(partDefi)
  File "C:\Users\Shahram\PycharmProjects\FlashCards\FlashCards\pyglossary\pyglossary\plugins\stardict.py", line 153, in xdxf_transform
    self.xdxf_setup()
  File "C:\Users\Shahram\PycharmProjects\FlashCards\FlashCards\pyglossary\pyglossary\plugins\stardict.py", line 149, in xdxf_setup
    self._xdxf_tr = xdxf_to_html_transformer()
  File "C:\Users\Shahram\PycharmProjects\FlashCards\FlashCards\pyglossary\pyglossary\xdxf_transform.py", line 7, in xdxf_to_html_transformer
    from lxml import etree
ImportError: DLL load failed: The specified module could not be found.
Traceback (most recent call last):
  File "C:\Users\Shahram\PycharmProjects\FlashCards\FlashCards\pyglossary\pyglossary\glossary.py", line 1182, in write
    for entry in self:
  File "C:\Users\Shahram\PycharmProjects\FlashCards\FlashCards\pyglossary\pyglossary\glossary.py", line 421, in _readersEntryGen
    for index, entry in enumerate(self._applyEntryFiltersGen(reader)):
  File "C:\Users\Shahram\PycharmProjects\FlashCards\FlashCards\pyglossary\pyglossary\glossary.py", line 433, in _applyEntryFiltersGen
    for index, entry in enumerate(gen):
  File "C:\Users\Shahram\PycharmProjects\FlashCards\FlashCards\pyglossary\pyglossary\plugins\stardict.py", line 306, in __iter__
    partDefi = self.xdxf_transform(partDefi)
  File "C:\Users\Shahram\PycharmProjects\FlashCards\FlashCards\pyglossary\pyglossary\plugins\stardict.py", line 153, in xdxf_transform
    self.xdxf_setup()
  File "C:\Users\Shahram\PycharmProjects\FlashCards\FlashCards\pyglossary\pyglossary\plugins\stardict.py", line 149, in xdxf_setup
    self._xdxf_tr = xdxf_to_html_transformer()
  File "C:\Users\Shahram\PycharmProjects\FlashCards\FlashCards\pyglossary\pyglossary\xdxf_transform.py", line 7, in xdxf_to_html_transformer
    from lxml import etree
ImportError: DLL load failed: The specified module could not be found.


[ERROR] Writing file 'C:/Users/Shahram/PycharmProjects/FlashCards/Anki Dictionaries/output/freedict.tei' failed.

@ilius
Copy link
Owner

ilius commented Nov 3, 2020

Why are trying to convert to .tei?

@ilius
Copy link
Owner

ilius commented Nov 3, 2020

Also there is probably something wrong with your installation of lxml.
https://stackoverflow.com/questions/7228229/lxml-dll-load-failed-the-specified-module-could-not-be-found

@shahram7
Copy link
Author

shahram7 commented Nov 3, 2020

Also there is probably something wrong with your installation of lxml.
https://stackoverflow.com/questions/7228229/lxml-dll-load-failed-the-specified-module-could-not-be-found

thank you 1000 times. I have uninstalled and reinstalled lxml. Problem solved.

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

No branches or pull requests

2 participants