r/OpenPythonSCAD • • Mar 19 '25

import python math in openpythonSCAD

Having trouble with a simple package import. Read through some other threads and still can't get it to work. import math

Installed: OpenSCAD-silicon-2025-01-30
Had python 3.12 installed, but couldn't import math, appended sys.path, but no luck
Installed python 3.13, and included the path in my sys.path and zshrc file.

Any ideas?

4 Upvotes

16 comments sorted by

View all comments

Show parent comment

2

u/MoaiJeff Mar 25 '25

I'm on Sequoia 15.3.2, using python 3.13.1, and this error was using 2025-03-20 PythonSCAD version

1

u/gadget3D Mar 25 '25

your error appears in line 28 and i doubt, that its about 'cube'

can you please share all your code, so i can test it locally here ?

1

u/MoaiJeff Mar 25 '25

The rest of the file was commented out. Here it is by itself.

from openscad import *
cu = cube([5,5,5])
cy = cylinder(5)
fusion = cu | cy
show(fusion)

give the error:
ERROR: Exception ignored in PyObject_HasAttrString(); consider using PyObject_HasAttrStringWithError(), PyObject_GetOptionalAttrString() or PyObject_GetAttrString():

Traceback (most recent call last):

File "<string>", line 3, in <module>

AttributeError: module '__main__' has no attribute 'fs'

2

u/gadget3D Mar 28 '25

i just found the bug.i will let you know, when its fixed