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

Error when converting zim into Stardict on Windows #580

Closed
Steven630 opened this issue Sep 11, 2024 · 15 comments
Closed

Error when converting zim into Stardict on Windows #580

Steven630 opened this issue Sep 11, 2024 · 15 comments

Comments

@Steven630
Copy link

C:\Users\64087>pyglossary
[INFO] Automatically switching to SQLite mode for writing Stardict
[INFO] Using sortKeyName = 'stardict'
[ERROR] Exception in Tkinter callback:
Traceback (most recent call last):
  File "C:\Users\64087\AppData\Local\Programs\Python\Python311\Lib\site-packages\pyglossary\ui\ui_tk.py", line 197, in CallWrapper__call__
    return self.func(*args)
           ^^^^^^^^^^^^^^^^
  File "C:\Users\64087\AppData\Local\Programs\Python\Python311\Lib\site-packages\pyglossary\ui\ui_tk.py", line 1489, in convert
    finalOutputFile = self.glos.convert(
                      ^^^^^^^^^^^^^^^^^^
  File "C:\Users\64087\AppData\Local\Programs\Python\Python311\Lib\site-packages\pyglossary\glossary_v2.py", line 1234, in convert
    return self.convertV2(args)
           ^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\64087\AppData\Local\Programs\Python\Python311\Lib\site-packages\pyglossary\glossary_v2.py", line 1176, in convertV2
    sort = self._convertPrepare(
           ^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\64087\AppData\Local\Programs\Python\Python311\Lib\site-packages\pyglossary\glossary_v2.py", line 1130, in _convertPrepare
    if not self._read(
           ^^^^^^^^^^^
  File "C:\Users\64087\AppData\Local\Programs\Python\Python311\Lib\site-packages\pyglossary\glossary_v2.py", line 729, in _read
    self.loadReader(reader)
  File "C:\Users\64087\AppData\Local\Programs\Python\Python311\Lib\site-packages\pyglossary\glossary_v2.py", line 747, in loadReader
    for entry in self._applyEntryFiltersGen(reader):
  File "C:\Users\64087\AppData\Local\Programs\Python\Python311\Lib\site-packages\pyglossary\glossary_v2.py", line 407, in _applyEntryFiltersGen
    for entry in gen:
  File "C:\Users\64087\AppData\Local\Programs\Python\Python311\Lib\site-packages\pyglossary\plugins\zimfile.py", line 128, in __iter__
    raise OSError("Unsupported operating system (no os.statvfs)") from None
OSError: Unsupported operating system (no os.statvfs)
Traceback (most recent call last):
  File "C:\Users\64087\AppData\Local\Programs\Python\Python311\Lib\site-packages\pyglossary\ui\ui_tk.py", line 197, in CallWrapper__call__
    return self.func(*args)
           ^^^^^^^^^^^^^^^^
  File "C:\Users\64087\AppData\Local\Programs\Python\Python311\Lib\site-packages\pyglossary\ui\ui_tk.py", line 1489, in convert
    finalOutputFile = self.glos.convert(
                      ^^^^^^^^^^^^^^^^^^
  File "C:\Users\64087\AppData\Local\Programs\Python\Python311\Lib\site-packages\pyglossary\glossary_v2.py", line 1234, in convert
    return self.convertV2(args)
           ^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\64087\AppData\Local\Programs\Python\Python311\Lib\site-packages\pyglossary\glossary_v2.py", line 1176, in convertV2
    sort = self._convertPrepare(
           ^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\64087\AppData\Local\Programs\Python\Python311\Lib\site-packages\pyglossary\glossary_v2.py", line 1130, in _convertPrepare
    if not self._read(
           ^^^^^^^^^^^
  File "C:\Users\64087\AppData\Local\Programs\Python\Python311\Lib\site-packages\pyglossary\glossary_v2.py", line 729, in _read
    self.loadReader(reader)
  File "C:\Users\64087\AppData\Local\Programs\Python\Python311\Lib\site-packages\pyglossary\glossary_v2.py", line 747, in loadReader
    for entry in self._applyEntryFiltersGen(reader):
  File "C:\Users\64087\AppData\Local\Programs\Python\Python311\Lib\site-packages\pyglossary\glossary_v2.py", line 407, in _applyEntryFiltersGen
    for entry in gen:
  File "C:\Users\64087\AppData\Local\Programs\Python\Python311\Lib\site-packages\pyglossary\plugins\zimfile.py", line 128, in __iter__
    raise OSError("Unsupported operating system (no os.statvfs)") from None
OSError: Unsupported operating system (no os.statvfs)
@ilius
Copy link
Owner

ilius commented Sep 12, 2024

I pushed a commit.
Please try again.

@Steven630
Copy link
Author

Thank you. But how do I update to the latest commit?

@ilius
Copy link
Owner

ilius commented Sep 12, 2024

How did you install it?

@Steven630
Copy link
Author

How did you install it?

By pip install in cmd

@ilius
Copy link
Owner

ilius commented Sep 12, 2024

Try:

pip install git+https://github.com/ilius/pyglossary

@Steven630
Copy link
Author

C:\Users\64087>pip install git+https://github.com/ilius/pyglossary
Collecting git+https://github.com/ilius/pyglossary
  Cloning https://github.com/ilius/pyglossary to c:\users\64087\appdata\local\temp\pip-req-build-tz4qpk15
  Running command git clone --filter=blob:none --quiet https://github.com/ilius/pyglossary 'C:\Users\64087\AppData\Local\Temp\pip-req-build-tz4qpk15'
  Resolved https://github.com/ilius/pyglossary to commit 4c78aa4f284fac36dba4d0f473d7ab9992d82956
  Installing build dependencies ... done
  Getting requirements to build wheel ... done
  Preparing metadata (pyproject.toml) ... done

I've installed this and used pyglossary to open the UI. But the error message is the same.

@ilius ilius reopened this Sep 13, 2024
@ilius
Copy link
Owner

ilius commented Sep 13, 2024

Try:

pip install -U git+https://github.com/ilius/pyglossary

@Steven630
Copy link
Author

Collecting git+https://github.com/ilius/pyglossary
  Cloning https://github.com/ilius/pyglossary to c:\users\64087\appdata\local\temp\pip-req-build-844_8wpj
  Running command git clone --filter=blob:none --quiet https://github.com/ilius/pyglossary 'C:\Users\64087\AppData\Local\Temp\pip-req-build-844_8wpj'
  Resolved https://github.com/ilius/pyglossary to commit 4c78aa4f284fac36dba4d0f473d7ab9992d82956
  Installing build dependencies ... done
  Getting requirements to build wheel ... done
  Preparing metadata (pyproject.toml) ... done

Still the same issue. :(

@ilius
Copy link
Owner

ilius commented Sep 13, 2024

Give me the whole console output again.

@Steven630
Copy link
Author

Steven630 commented Sep 13, 2024

Give me the whole console output again.

C:\Users\64087>pyglossary
[INFO] Automatically switching to SQLite mode for writing Stardict
[INFO] Using sortKeyName = 'stardict'
[INFO] Removing and re-creating 'C:\Users\64087\AppData\Local\PyGlossary\Cache\wiktionary_en_simple_all_nopic_2024-06.zim.db'
[ERROR] Exception in Tkinter callback:
Traceback (most recent call last):
File "C:\Users\64087\AppData\Local\Programs\Python\Python311\Lib\site-packages\pyglossary\ui\ui_tk.py", line 197, in CallWrapper__call__
return self.func(*args)
^^^^^^^^^^^^^^^^
File "C:\Users\64087\AppData\Local\Programs\Python\Python311\Lib\site-packages\pyglossary\ui\ui_tk.py", line 1489, in convert
finalOutputFile = self.glos.convert(
^^^^^^^^^^^^^^^^^^
File "C:\Users\64087\AppData\Local\Programs\Python\Python311\Lib\site-packages\pyglossary\glossary_v2.py", line 1234, in convert
return self.convertV2(args)
^^^^^^^^^^^^^^^^^^^^
File "C:\Users\64087\AppData\Local\Programs\Python\Python311\Lib\site-packages\pyglossary\glossary_v2.py", line 1176, in convertV2
sort = self._convertPrepare(
^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\64087\AppData\Local\Programs\Python\Python311\Lib\site-packages\pyglossary\glossary_v2.py", line 1130, in _convertPrepare
if not self._read(
^^^^^^^^^^^
File "C:\Users\64087\AppData\Local\Programs\Python\Python311\Lib\site-packages\pyglossary\glossary_v2.py", line 729, in _read
self.loadReader(reader)
File "C:\Users\64087\AppData\Local\Programs\Python\Python311\Lib\site-packages\pyglossary\glossary_v2.py", line 747, in loadReader
for entry in self.applyEntryFiltersGen(reader):
File "C:\Users\64087\AppData\Local\Programs\Python\Python311\Lib\site-packages\pyglossary\glossary_v2.py", line 407, in applyEntryFiltersGen
for entry in gen:
File "C:\Users\64087\AppData\Local\Programs\Python\Python311\Lib\site-packages\pyglossary\plugins\zimfile.py", line 128, in iter
raise OSError("Unsupported operating system (no os.statvfs)") from None
OSError: Unsupported operating system (no os.statvfs)
Traceback (most recent call last):
File "C:\Users\64087\AppData\Local\Programs\Python\Python311\Lib\site-packages\pyglossary\ui\ui_tk.py", line 197, in CallWrapper__call

return self.func(*args)
^^^^^^^^^^^^^^^^
File "C:\Users\64087\AppData\Local\Programs\Python\Python311\Lib\site-packages\pyglossary\ui\ui_tk.py", line 1489, in convert
finalOutputFile = self.glos.convert(
^^^^^^^^^^^^^^^^^^
File "C:\Users\64087\AppData\Local\Programs\Python\Python311\Lib\site-packages\pyglossary\glossary_v2.py", line 1234, in convert
return self.convertV2(args)
^^^^^^^^^^^^^^^^^^^^
File "C:\Users\64087\AppData\Local\Programs\Python\Python311\Lib\site-packages\pyglossary\glossary_v2.py", line 1176, in convertV2
sort = self._convertPrepare(
^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\64087\AppData\Local\Programs\Python\Python311\Lib\site-packages\pyglossary\glossary_v2.py", line 1130, in _convertPrepare
if not self._read(
^^^^^^^^^^^
File "C:\Users\64087\AppData\Local\Programs\Python\Python311\Lib\site-packages\pyglossary\glossary_v2.py", line 729, in _read
self.loadReader(reader)
File "C:\Users\64087\AppData\Local\Programs\Python\Python311\Lib\site-packages\pyglossary\glossary_v2.py", line 747, in loadReader
for entry in self._applyEntryFiltersGen(reader):
File "C:\Users\64087\AppData\Local\Programs\Python\Python311\Lib\site-packages\pyglossary\glossary_v2.py", line 407, in _applyEntryFiltersGen
for entry in gen:
File "C:\Users\64087\AppData\Local\Programs\Python\Python311\Lib\site-packages\pyglossary\plugins\zimfile.py", line 128, in iter
raise OSError("Unsupported operating system (no os.statvfs)") from None
OSError: Unsupported operating system (no os.statvfs)

@ilius
Copy link
Owner

ilius commented Sep 14, 2024

For some reason, it's not being updated (maybe you have two installations).

Please download manually: go to https://github.com/ilius/pyglossary and click the green "Code" button, and "Download ZIP". Then extract it and double-click on main.py

@Steven630
Copy link
Author

Steven630 commented Sep 17, 2024

I have updated to 4.7.1 and got the following error

[INFO] Automatically switching to SQLite mode for writing Stardict
[INFO] Using sortKeyName = 'stardict'
[INFO] Removing and re-creating 'C:\Users\64087\AppData\Local\PyGlossary\Cache\wiktionary_en_simple_all_nopic_2024-06.zim.db'
[WARNING] Unsupported operating system (no os.statvfs)
[WARNING] Unrecognized mimetype='undefined'
[WARNING] Unrecognized mimetype='undefined'
[WARNING] Unrecognized mimetype='undefined'
[ERROR] resource title: mw/skins.minerva.base.reset|skins.minerva.content.styles|ext.cite.style|site.styles|mobile.app.pagestyles.android|mediawiki.page.gallery.styles|mediawiki.skinning.content.parsoid.css
[ERROR] Exception in Tkinter callback:
Traceback (most recent call last):
File "C:\Users\64087\AppData\Local\Programs\Python\Python311\Lib\site-packages\pyglossary\ui\ui_tk.py", line 197, in CallWrapper__call__
return self.func(*args)
^^^^^^^^^^^^^^^^
File "C:\Users\64087\AppData\Local\Programs\Python\Python311\Lib\site-packages\pyglossary\ui\ui_tk.py", line 1489, in convert
finalOutputFile = self.glos.convert(
^^^^^^^^^^^^^^^^^^
File "C:\Users\64087\AppData\Local\Programs\Python\Python311\Lib\site-packages\pyglossary\glossary_v2.py", line 1274, in convert
return self.convertV2(args)
^^^^^^^^^^^^^^^^^^^^
File "C:\Users\64087\AppData\Local\Programs\Python\Python311\Lib\site-packages\pyglossary\glossary_v2.py", line 1216, in convertV2
sort = self._convertPrepare(
^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\64087\AppData\Local\Programs\Python\Python311\Lib\site-packages\pyglossary\glossary_v2.py", line 1170, in _convertPrepare
if not self._read(
^^^^^^^^^^^
File "C:\Users\64087\AppData\Local\Programs\Python\Python311\Lib\site-packages\pyglossary\glossary_v2.py", line 767, in _read
self.loadReader(reader)
File "C:\Users\64087\AppData\Local\Programs\Python\Python311\Lib\site-packages\pyglossary\glossary_v2.py", line 785, in loadReader
for entry in self.applyEntryFiltersGen(reader):
File "C:\Users\64087\AppData\Local\Programs\Python\Python311\Lib\site-packages\pyglossary\glossary_v2.py", line 439, in applyEntryFiltersGen
for entry in gen:
File "C:\Users\64087\AppData\Local\Programs\Python\Python311\Lib\site-packages\pyglossary\plugins\zimfile.py", line 198, in iter
yield glos.newDataEntry(word, b_content)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\64087\AppData\Local\Programs\Python\Python311\Lib\site-packages\pyglossary\glossary_v2.py", line 613, in newDataEntry
return DataEntry(
^^^^^^^^^^
File "C:\Users\64087\AppData\Local\Programs\Python\Python311\Lib\site-packages\pyglossary\entry.py", line 55, in init
with open(tmpPath, "wb") as toFile:
^^^^^^^^^^^^^^^^^^^
FileNotFoundError: [Errno 2] No such file or directory: 'C:\Users\64087\AppData\Local\PyGlossary\Cache\wiktionary_en_simple_all_nopic_2024-06.zim_res\mw_skins.minerva.base.reset|skins.minerva.content.styles|ext.cite.style|site.styles|mobile.app.pagestyles.android|mediawiki.page.gallery.styles|mediawiki.skinning.content.parsoid.css'
Traceback (most recent call last):
File "C:\Users\64087\AppData\Local\Programs\Python\Python311\Lib\site-packages\pyglossary\ui\ui_tk.py", line 197, in CallWrapper__call

return self.func(*args)
^^^^^^^^^^^^^^^^
File "C:\Users\64087\AppData\Local\Programs\Python\Python311\Lib\site-packages\pyglossary\ui\ui_tk.py", line 1489, in convert
finalOutputFile = self.glos.convert(
^^^^^^^^^^^^^^^^^^
File "C:\Users\64087\AppData\Local\Programs\Python\Python311\Lib\site-packages\pyglossary\glossary_v2.py", line 1274, in convert
return self.convertV2(args)
^^^^^^^^^^^^^^^^^^^^
File "C:\Users\64087\AppData\Local\Programs\Python\Python311\Lib\site-packages\pyglossary\glossary_v2.py", line 1216, in convertV2
sort = self._convertPrepare(
^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\64087\AppData\Local\Programs\Python\Python311\Lib\site-packages\pyglossary\glossary_v2.py", line 1170, in _convertPrepare
if not self._read(
^^^^^^^^^^^
File "C:\Users\64087\AppData\Local\Programs\Python\Python311\Lib\site-packages\pyglossary\glossary_v2.py", line 767, in _read
self.loadReader(reader)
File "C:\Users\64087\AppData\Local\Programs\Python\Python311\Lib\site-packages\pyglossary\glossary_v2.py", line 785, in loadReader
for entry in self._applyEntryFiltersGen(reader):
File "C:\Users\64087\AppData\Local\Programs\Python\Python311\Lib\site-packages\pyglossary\glossary_v2.py", line 439, in _applyEntryFiltersGen
for entry in gen:
File "C:\Users\64087\AppData\Local\Programs\Python\Python311\Lib\site-packages\pyglossary\plugins\zimfile.py", line 198, in iter
yield glos.newDataEntry(word, b_content)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\64087\AppData\Local\Programs\Python\Python311\Lib\site-packages\pyglossary\glossary_v2.py", line 613, in newDataEntry
return DataEntry(
^^^^^^^^^^
File "C:\Users\64087\AppData\Local\Programs\Python\Python311\Lib\site-packages\pyglossary\entry.py", line 55, in init
with open(tmpPath, "wb") as toFile:
^^^^^^^^^^^^^^^^^^^
FileNotFoundError: [Errno 2] No such file or directory: 'C:\Users\64087\AppData\Local\PyGlossary\Cache\wiktionary_en_simple_all_nopic_2024-06.zim_res\mw_skins.minerva.base.reset|skins.minerva.content.styles|ext.cite.style|site.styles|mobile.app.pagestyles.android|mediawiki.page.gallery.styles|mediawiki.skinning.content.parsoid.css'

@ilius
Copy link
Owner

ilius commented Sep 17, 2024

Can you please open a new issue for this error?

@Steven630
Copy link
Author

OK

@Steven630
Copy link
Author

#585

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