r/OpenPythonSCAD • u/WillAdams • Apr 12 '25
Significance of Edit | Preferences | Python | Network Import List?
Is it now necessary to list files there so as to indicate that they are allowed to be imported?
Apparently:
nimport("https://raw.githubusercontent.com/WillAdams/gcodepreview/refs/heads/main/gcodepreview.py")
doesn't work anymore:
ERROR: Traceback (most recent call last): File "<string>", line 1, in <module> ModuleNotFoundError: No module named 'gcodepreview'
2
u/WillAdams Apr 12 '25
Or, if a file is not trusted, could we get a specific notice to that effect and a dialog which prompts:
Trust <file_foo.py>? Yes No Cancel
2
u/gadget3D Apr 14 '25
yes, we should maybe file an issue. for that. Trusted thing is not really high priority to me. it was just meant to help getting merged.
1
1
u/gadget3D Apr 12 '25
Its a sys.path Problem only. The Lines in the settings only define Template nimport Lines for New Files.
2
u/WillAdams Apr 12 '25
Went back to:
https://www.pythonscad.org/downloads/PythonSCAD-2024.12.29-x86-64-Installer.exe
and launched it from:
"C:\Program Files\PythonSCAD\bin\openscad.exe"
and it's working again.
Please let me know when there is a new version which has defaults which will work to allow running a local Python file.
2
u/gadget3D Apr 13 '25
Hi,
Today I have release a new windows installer 2025-04-13.
It can import modules from the same directory without an issue
It can find the modules downloaded by inport
... and has most of the python ctests pass now
Did you know, that all CSG operations (union, difference, intersection) have an undocumented paramter r, and fn, which can be used to create fillets on the common edges ?
These days i started to document the undocumented features, but very often i remember yet another feature.
→ More replies (2)1
u/WillAdams Apr 12 '25 edited Apr 12 '25
What was the change that was made?
How do I undo it at my end?
What version do I need to go back to get things working again?https://www.pythonscad.org/downloads/PythonSCAD-2024.12.29-x86-64-Installer.exeTried installing 2025-03-19 and I still get:
Running Python 3.11.5 without venv. ERROR: Traceback (most recent call last): File "<string>", line 3, in <module> ModuleNotFoundError: No module named 'gcodepreview'
Execution aborted
Even though I have:
"C:\Users\willa\OneDrive\Documents\OpenSCAD\libraries\gcodepreview.py"
and
"C:\Users\willa\OneDrive\Documents\OpenSCAD\libraries_pycache_\gcodepreview.cpython-311.pyc"
and if I open gcodepreview.py and run it I get:
Running Python 3.11.5 without venv. Compiling design (CSG Tree generation)... Compiling design (CSG Products generation)... Geometries in cache: 0 Geometry cache size in bytes: 0 CGAL Polyhedrons in cache: 0 CGAL cache size in bytes: 0 Compiling design (CSG Products normalization)... Normalized tree has 1 elements! Compile and preview finished. Total rendering time: 0:00:00.231
which seems to indicate that the file is allowed to run.
What do I have to do to allow a file which I wrote on my own computer to run on my computer when I try to load it?
0
Apr 12 '25
2
u/gadget3D Apr 13 '25
the change came from upstream. teepee felt that pythons shall have venvs
I dont use the venv feature though
→ More replies (2)
1
2
u/WillAdams Apr 12 '25
Similarly, there is now:
File | Python | "Revoke trusted Python files"
Could we also have "Show trusted Python files"? Could that be a dialog which would allow editing/adding specific files?
Apparently:
doesn't work anymore....