MITMotorsports / CANlib

An automatically generated C library for packing and unpacking based on ParseCAN specifications.
Apache License 2.0
5 stars 4 forks source link

Fixed python relative paths #13

Closed CharlieA0 closed 5 years ago

CharlieA0 commented 5 years ago

Just fixes the python import paths

nistath commented 5 years ago

I don't understand what you're fixing, this works if you run from the correct directory.

CharlieA0 commented 5 years ago

@nistath cloning a clean copy of MY19, initializing/updating submodules, and then trying to build the VCU's canlib results in the following error.

 Generating CANlib...
 Traceback (most recent call last):
   File "main.py", line 6, in <module>
     import pack_unpack_c
   File "/home/charlie/MY19/lib/CANlib/generator/pack_unpack_c.py", line 4, in <module>
     from ParseCAN.spec import Endianness, Type
 ModuleNotFoundError: No module named 'ParseCAN.spec'
     ../../build/board.mk:452: recipe for target '../../my19_can_spec.yml' failed
     make: *** [../../my19_can_spec.yml] Error 1

This is because importing ParseCAN's code is in the ParseCAN folder under the ParseCAN module. We can fix this by importing along the correct path.

daniwhite commented 5 years ago

@CharlieA0 this is not true with the current version of MY19.