Code Monkey home page Code Monkey logo

Comments (4)

eerimoq avatar eerimoq commented on June 14, 2024

I get this output for the same input:

> python 
Python 2.7.12 (default, Nov 20 2017, 18:23:56) 
[GCC 5.4.0 20160609] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import cantools
>>> import pyparsing
>>> cantools.__version__
16.2.0
>>> pyparsing.__version__
2.2.0
>>> cantools.db.formats.dbc.load_string("")
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "cantools/db/formats/dbc.py", line 879, in load_string
    e.msg))
cantools.db.formats.utils.ParseError: Invalid DBC syntax at line 1, column 1: '>!<': Expected {VERSION | NS_ | BS_ | BU_ | BO_ | CM_ | BA_DEF_ | BA_DEF_DEF_ | BA_ | VAL_ | VAL_TABLE_ | SIG_VALTYPE_ | SG_MUL_VAL_ | BO_TX_BU_ | BA_DEF_REL_ | BA_DEF_DEF_REL_ | BA_REL_ | EV_}.
>>> 

Is there a problem with your Python or pyparsing installation? I'm using pyparsing 2.2.0.

from cantools.

sietschie avatar sietschie commented on June 14, 2024

I was using pyparsing 1.5.6. After I manually installed version 2.2.0 I got the same message you got and the DBC file gets parsed as expected. Thank you. Maybe you can add the minimum required version of pyparsing to the requirements of the tool so that the setup makes sure the correct version is installed?

And thank you for the quick reply.

from cantools.

eerimoq avatar eerimoq commented on June 14, 2024

There is already an requirement for pyparsing 2.0.3: https://github.com/eerimoq/cantools/blob/master/setup.py#L21-L22

Not sure why your pyparsing was not updated, maybe one have to do pip install -U cantools, to force packages to be updated? I'm a setuptools novice, so I might be wrong.

from cantools.

sietschie avatar sietschie commented on June 14, 2024

Okay. This probably was an issue with my python. For some reason pip thought, 2.2.0 was installed even though it wasn't. Thank you for your assistance.

from cantools.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.