Describe the bug
I like to do my scad in VSCode because it's much more feature rich than the built-in editor. In testing the nightly version, I wanted to try converting my current project to Python. However, I cannot find any way to access the openscad module from anywhere outside of the built-in editor. I create a virtual environment, and point the Python extension in VSCode to the venv's bin/openscad-python binary, but the type checker still says there is no openscad module. Sourcing the bin/activate script in a shell and trying to import it there gives the same error. I've looked at the code that I think loads the module and to be honest, I don't entirely understand how it works.
Is there a trick to loading the module externally, or is not possible currently?
To Reproduce
Steps to reproduce the behavior:
- Enable Python in settings or run with
--enable python-engine --trust-python
- Create a virtualenv from the File > Python menu
- Open a shell and run:
cd <path to virtualenv>
. bin/activate
python -c 'import openscad'
Expected behavior
It should exit cleanly as it found the module and imported it successfully
Screenshots


Environment and Version info:
- OS: KDE Neon (Ubuntu 24.04 base)
- System: Linux Desktop, AMD64
- OpenSCAD Version: 20260426T194550.gitb38f6888.debian-0 (APT nightly repo)
Additional context
I think installing the module into the venv's site-packages would be easier to work with, but I don't know the reasons for loading it in whatever weird way it does currently. I don't really care how it's loaded as long as working with the Python API externally is easy and intuitive. Currently it is not. 😕
Describe the bug
I like to do my scad in VSCode because it's much more feature rich than the built-in editor. In testing the nightly version, I wanted to try converting my current project to Python. However, I cannot find any way to access the
openscadmodule from anywhere outside of the built-in editor. I create a virtual environment, and point the Python extension in VSCode to the venv'sbin/openscad-pythonbinary, but the type checker still says there is noopenscadmodule. Sourcing thebin/activatescript in a shell and trying to import it there gives the same error. I've looked at the code that I think loads the module and to be honest, I don't entirely understand how it works.Is there a trick to loading the module externally, or is not possible currently?
To Reproduce
Steps to reproduce the behavior:
--enable python-engine --trust-pythonExpected behavior
It should exit cleanly as it found the module and imported it successfully
Screenshots


Environment and Version info:
Additional context
I think installing the module into the venv's site-packages would be easier to work with, but I don't know the reasons for loading it in whatever weird way it does currently. I don't really care how it's loaded as long as working with the Python API externally is easy and intuitive. Currently it is not. 😕