No module named 'ezdxf.math.vector' in v8.994 BETA - fixed for next version
Issue #477 new
The progam fails to start with ezdxf version 0.15 and throws the following error
$ flatcam Traceback (most recent call last): File "/opt/flatcam/FlatCAM.py", line 6, in <module> from app_Main import App File "/opt/flatcam/app_Main.py", line 52, in <module> from appDatabase import ToolsDB2 File "/opt/flatcam/appDatabase.py", line 4, in <module> from camlib import to_dict File "/opt/flatcam/camlib.py", line 54, in <module> from appParsers.ParseDXF import * File "/opt/flatcam/appParsers/ParseDXF.py", line 10, in <module> from ezdxf.math.vector import Vector as ezdxf_vector ModuleNotFoundError: No module named 'ezdxf.math.vector'
It seems that the class “ezdxf.math.vector.Vector” has been renamed to “ezdxf.math.Vec3“ according to the changelog (https://github.com/mozman/ezdxf/blob/master/NEWS.md)
I think that a simple way to fix this, keeping the backward compatibility with the older versions of ezdxf, is to change the line 10 of the file
from ezdxf.math.vector import Vector as ezdxf_vector
try: from ezdxf.math.vector import Vector as ezdxf_vector except ImportError: from ezdxf.math import Vec3 as ezdxf_vector
As far as I can see the latest version of ezdxf is 0.14.2 but there is a beta2 version of edxf 0.15.
Thank you for the report and for the code suggestion but I will wait until the final version of ezdxf 0.15 is released. In case there are other changes.
The new version of ezdxf is out.
As of the ezdxf Version 0.15 - 2020-12-30, we have the following message:
This is due to:
Vectorremains as synonym
The code says
But this way, the synonym does not work.
The code should probably be changed to:
That has the advantage of being also compatible with older versions of the lib. (in fact, there is no
ezdxf.math.vector, even in older versions)
But the try/catch as proposed above also works of course.
#480was marked as a duplicate of this issue.
Thank you all!
I’ve made the changes in my working copy, the changes will be made available on the 8.995 release.
Cheers for the suggested fix, got me up and running