r/OpenPythonSCAD • • Apr 04 '25

Did loading libraries change in the new version? (2025-04-02)

I think this happened in 2025-03-31 as well...

Trying to load:

from openscad import *

from gcodepreview import *

gc_file = "vcarvetest.nc"

gcp = gcodepreview(True, False, False)

gcp.previewgcodefile(gc_file)

and am getting:

Running Python 3.11.5 in venv ''. ERROR: Traceback (most recent call last): File "<string>", line 3, in <module> ModuleNotFoundError: No module named 'gcodepreview'

Execution aborted

where File | Show Library Folder opens: C:\Users\willa\OneDrive\Documents\OpenSCAD\libraries

which contains:

"C:\Users\willa\OneDrive\Documents\OpenSCAD\libraries\gcodepreview.py" and "C:\Users\willa\OneDrive\Documents\OpenSCAD\libraries\gcodepreview.scad"

3 Upvotes

13 comments sorted by

View all comments

Show parent comment

2

u/gadget3D Apr 08 '25

yes of course. i just did not realize, that this path got missed.

1

u/gadget3D Apr 08 '25

https://github.com/pythonscad/pythonscad/commit/46a535129f12a909a48d2f41252c475df1a9c0c7

got small doubts that that worked before because the python engine never knew the absolute path early enough.

But now after some restructuring, it does.