r/OpenPythonSCAD • u/WillAdams • Jul 16 '25
Installing 3rd party/arbitrary Python libraries into Windows
given that the Windows version (and others?) now have an internal Python, this becomes something of an issue.
It used to work to e.g., install a library into the "main" Python and then access it from w/in OpenPythonSCAD, but now an installed library cannot be seen from w/in OPS, and attempting to install one using code:
import os, sys
os.system(sys.executable + '-m pip install -user gscrib')doesn't seem to work since the test file responds with:
Parsing design (AST generation)... Running Python 3.12.9 without venv. ERROR: Traceback (most recent call last): File "<string>", line 1, in <module> ModuleNotFoundError: No module named 'gscrib'
Is anyone else trying to use things other than sys and math (which I believe still work?)
(this is with the new 2025-07-15)
View all comments
Show parent comment
1
u/gadget3D Jul 17 '25
This evaluates the directory where your model sits in and appends it to sys.path.
With that in place you can easily import python files which sit NEXT to your model file.