Setting PATH environment variables for VTK build tree on Windows

Ok I have solved the not finding numpy issue in the case of vtkpython. You have to add the path in the virtual environment path (\Lib\site-packages) to %PYTHONPATH% to get it.

The windows_path.*.bat files in your $VTK_build folder also set that up.

The .bat file only sets up the VTK bin and the VTK site_packages path not the path to the virtual environment site_packages path. I actually use this file to set up those paths. numpy is in the virtual environment not the base environment in this case, this is what is causing the issue.

What is considered good practice? Should numpy, scipy matplotlib always be in the base path or should they be in only the virtual environments where needed?


There are too many env managers to support all of them. Conda envs, virtualenv, venv, Spack, and more I’m sure I’m not aware of. The .bat file should just handle adding VTK’s build tree to the relevant environment variables and be able to stack on top of whatever the user is using to provide other Python packages.

I quite agree, it would add too much overhead. At least if someone uses vtkpython and finds numpy or matplotlib not working, we may have a solution for them.