ebroecker / canmatrix

Converting Can (Controller Area Network) Database Formats .arxml .dbc .dbf .kcd ...
BSD 2-Clause "Simplified" License
911 stars 401 forks source link

canconvert -h gives errors #634

Closed trvini closed 2 years ago

trvini commented 2 years ago

Hi,

I installed canmatrix on ubuntu machine. i also tried installing the branch iss_632 as mentioned in the issue https://github.com/ebroecker/canmatrix/issues/632 , but i still get the following error. Thanks for your support.

bm@up2-2:~$ cat /etc/os-release 
NAME="Ubuntu"
VERSION="20.04.4 LTS (Focal Fossa)"
ID=ubuntu
ID_LIKE=debian
PRETTY_NAME="Ubuntu 20.04.4 LTS"
VERSION_ID="20.04"
HOME_URL="https://www.ubuntu.com/"
SUPPORT_URL="https://help.ubuntu.com/"
BUG_REPORT_URL="https://bugs.launchpad.net/ubuntu/"
PRIVACY_POLICY_URL="https://www.ubuntu.com/legal/terms-and-policies/privacy-policy"
VERSION_CODENAME=focal
UBUNTU_CODENAME=focal
bm@up2-2:~$ python --version
Python 2.7.18
bm@up2-2:~$ python3 --version
Python 3.8.10
bm@up2-2:~$ canconvert -h
ldf is not supported
Traceback (most recent call last):
  File "/home/bm/.local/bin/canconvert", line 5, in <module>
    from canmatrix.cli.convert import cli_convert
  File "/home/bm/.local/lib/python3.8/site-packages/canmatrix/__init__.py", line 8, in <module>
    import canmatrix.formats as formats
  File "/home/bm/.local/lib/python3.8/site-packages/canmatrix/formats/__init__.py", line 25, in <module>
    importlib.import_module("canmatrix.formats." + module)
  File "/usr/lib/python3.8/importlib/__init__.py", line 127, in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
  File "/home/bm/.local/lib/python3.8/site-packages/canmatrix/formats/xls.py", line 35, in <module>
    import xlwt
  File "/home/bm/.local/lib/python3.8/site-packages/xlwt/__init__.py", line 5, in <module>
    from .Row import Row
  File "/home/bm/.local/lib/python3.8/site-packages/xlwt/Row.py", line 9, in <module>
    from . import ExcelFormula
  File "/home/bm/.local/lib/python3.8/site-packages/xlwt/ExcelFormula.py", line 8, in <module>
    from . import ExcelFormulaParser, ExcelFormulaLexer
  File "/home/bm/.local/lib/python3.8/site-packages/xlwt/ExcelFormulaLexer.py", line 53, in <module>
    _re = recompile(
  File "/usr/lib/python3.8/re.py", line 252, in compile
    return _compile(pattern, flags)
  File "/usr/lib/python3.8/re.py", line 304, in _compile
    p = sre_compile.compile(pattern, flags)
  File "/usr/lib/python3.8/sre_compile.py", line 764, in compile
    p = sre_parse.parse(p, flags)
  File "/usr/lib/python3.8/sre_parse.py", line 958, in parse
    p.state.flags = fix_flags(str, p.state.flags)
  File "/usr/lib/python3.8/sre_parse.py", line 925, in fix_flags
    raise ValueError("cannot use LOCALE flag with a str pattern")
ValueError: cannot use LOCALE flag with a str pattern
bm@up2-2:~$ 
ebroecker commented 2 years ago

... seems to be an issue of some specific xlwt version, which xlwt-version do you have installed?

trvini commented 2 years ago

Thank you for your reply. I installed the latest version as mentioned in your install instructions' from https://pypi.org/project/xlwt-future/ .

bm@up2-2:~$ pip show xlwt-future
Name: xlwt-future
Version: 0.8.0
Summary: Library to create spreadsheet files compatible with MS Excel 97/2000/XP/2003 XLS files, on any platform, with Python 2.6 to 3.3
Home-page: http://www.python-excel.org/
Author: None
Author-email: None
License: BSD
Location: /home/bm/.local/lib/python3.8/site-packages
Requires: future
Required-by: 
bm@up2-2:~$ 
ebroecker commented 2 years ago

could you try xlwt-version 1.3.0?

trvini commented 2 years ago

Hello, Thanks for the tip I uninstalled the xlwt-future pip uninstall xlwt-future and I still found that xlwt version was existing so I uninstalled xlwt completely by pip uninstall xlwt. Then I reinstalled with pip3 install 'xlwt==1.3.0' Now it seems to work as below. But I still see ldf is not supported error as below. I am not sure if it has any side effect

bm@up2-2:~/canmatrix/test$ canconvert --help
ldf is not supported
Usage: canconvert [OPTIONS] INFILE OUTFILE
...
...
ebroecker commented 2 years ago

Hi @trvini ,

ldf is not supported just means, that you cannot import .ldf files (lin bus description). If this is not your use case - you can safely ignore this message.

The old excel-libraries (.xls) are beginning to make problems. Maybe I abandon these and will support only xlsx files in future

trvini commented 2 years ago

Thank you !