Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

VERSION file not found on Python 3.6 after install #2

Open
matfrem opened this issue Nov 4, 2021 · 1 comment
Open

VERSION file not found on Python 3.6 after install #2

matfrem opened this issue Nov 4, 2021 · 1 comment

Comments

@matfrem
Copy link

matfrem commented Nov 4, 2021

Error on Python 3.6
I used pip install po-excel-translate to install.

xls2po fr-FR ./messages.xlsx ./fr-FR.po

Traceback (most recent call last):
  File "c:\users\XX\appdata\local\programs\python\python38-32\lib\runpy.py", line 192, in _run_module_as_main
    return _run_code(code, main_globals, None,
  File "c:\users\XX\appdata\local\programs\python\python38-32\lib\runpy.py", line 85, in _run_code
    exec(code, run_globals)
  File "C:\Users\XX\AppData\Local\Programs\Python\Python38-32\Scripts\xls2po.exe\__main__.py", line 7, in <module>
  File "c:\users\XX\appdata\local\programs\python\python38-32\lib\site-packages\click\core.py", line 1128, in __call__
    return self.main(*args, **kwargs)
  File "c:\users\XX\appdata\local\programs\python\python38-32\lib\site-packages\click\core.py", line 1053, in main
    rv = self.invoke(ctx)
  File "c:\users\XX\appdata\local\programs\python\python38-32\lib\site-packages\click\core.py", line 1395, in invoke
    return ctx.invoke(self.callback, **ctx.params)
  File "c:\users\XX\appdata\local\programs\python\python38-32\lib\site-packages\click\core.py", line 754, in invoke
    return __callback(*args, **kwargs)
  File "c:\users\XX\appdata\local\programs\python\python38-32\lib\site-packages\xls2po.py", line 19, in main
    XLSXToPortableObjectFile(locale=locale, input_file_path=Path(str(input_file)), output_file_path=Path(output_file))
  File "c:\users\XX\appdata\local\programs\python\python38-32\lib\site-packages\po_excel_translate.py", line 419, in __init__
    with open(os.path.join(root_dir, "VERSION")) as version_file:
FileNotFoundError: [Errno 2] No such file or directory: 'c:\\users\\XX\\appdata\\local\\programs\\python\\python38-32\\lib\\site-packages\\VERSION'

After check file c:\users\XX\appdata\local\programs\python\python38-32\lib\site-packages\VERSION does not exist.
Commented line 419 of "po_excel_translate.py". Works like a charm.

Note : po2xls works without this fix.

Thank you for your work !

@zhmxiaowo
Copy link

zhmxiaowo commented Aug 2, 2023

1.add VERSION(put a "1.0" inside) file in c:\users\XX\appdata\local\programs\python\python38-32\lib\site-packages\VERSION
2. change the po_excel_translate.py code like this:
path: c:\users\XX\appdata\local\programs\python\python38-32\lib\site-packages\po_excel_translate.py

        root_dir = os.path.dirname(os.path.abspath(__file__))
        # with open(os.path.join(root_dir, "VERSION")) as version_file:
        #     version = version_file.read().strip()
        version = "1.0"

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants