mtl / svg2mod

Convert Inkscape SVG drawings to KiCad footprint modules
Creative Commons Zero v1.0 Universal
236 stars 56 forks source link

module has no attribute 'parse' #11

Closed mattvenn closed 7 years ago

mattvenn commented 7 years ago

Had a quick look through the included svg library but didn't spot anything obvious.

./svg2mod.py -i examples/dt-logo.svg Parsing SVG... Traceback (most recent call last): File "./svg2mod.py", line 1433, in main() File "./svg2mod.py", line 39, in main args.module_value File "./svg2mod.py", line 444, in init self.svg = svg.parse( file_name ) AttributeError: 'module' object has no attribute 'parse'

kasbah commented 7 years ago

Hey Matt!

I just tried it with a fresh clone and can't reproduce it. Maybe something weird is going on with the imports. Have you tried it in a virtualenv?

mattvenn commented 7 years ago

huh, yes just tried in a virtual env and no no problems. I thought any svg module I'd already have installed would be overridden by the one included.

kasbah commented 7 years ago

That doesn't seem to be the case and it appears to be non trivial to load relative imports in a script in a non-hacky way. This should probably be fixed somehow to avoid this issue in the future so I would recommend to re-open it. What SVG package do you have installed?

mattvenn commented 7 years ago

It's a very strangely named package called svg.path that installs itself like svg/path/ so you can import svg and get nothing.

On 16 November 2016 at 18:32, Kaspar Emanuel notifications@github.com wrote:

That doesn't seem to be the case and it appears to be non trivial to load relative imports in a script in a non-hacky way https://stackoverflow.com/questions/14132789/relative-imports-for-the-billionth-time. This should probably be fixed somehow to avoid this issue in the future so I would recommend to re-open it. What SVG package do you have installed?

— You are receiving this because you modified the open/close state. Reply to this email directly, view it on GitHub https://github.com/mtl/svg2mod/issues/11#issuecomment-261013985, or mute the thread https://github.com/notifications/unsubscribe-auth/AAmtbKF9K1pbV-Y3fgBHvfPZ47ecxSrOks5q-z4ngaJpZM4K0CAR .

Matthew Venn web mattvenn.net twitter @matthewvenn https://twitter.com/matthewvenn