po-excel-translate
po-excel-translate copied to clipboard
VERSION file not found on Python 3.6 after install
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 !
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"