# Setting PATH environment variables for VTK build tree on Windows

**URL:** https://discourse.vtk.org/t/setting-path-environment-variables-for-vtk-build-tree-on-windows/7788
**Category:** Support
**Created:** [February 5, 2022, 6:29am UTC](https://discourse.vtk.org/t/setting-path-environment-variables-for-vtk-build-tree-on-windows/7788 "2022-02-05T06:29:14Z")
**Posts on this page:** 5
**Page:** 1

<div class="post-metadata">

### Author: ![amaclean](https://discourse.vtk.org/user_avatar/discourse.vtk.org/amaclean/32/224_2.png) [@amaclean](https://discourse.vtk.org/u/amaclean)
#### Post date: [February 5, 2022, 6:29am UTC](https://discourse.vtk.org/t/setting-path-environment-variables-for-vtk-build-tree-on-windows/7788/1 "2022-02-05T06:29:14Z")

</div>

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.

---

<div class="post-metadata">

### Author: ![toddy](https://discourse.vtk.org/letter_avatar_proxy/v4/letter/t/edb3f5/32.png) [@toddy](https://discourse.vtk.org/u/toddy)
#### Post date: [February 7, 2022, 12:28am UTC](https://discourse.vtk.org/t/setting-path-environment-variables-for-vtk-build-tree-on-windows/7788/2 "2022-02-07T00:28:31Z")

</div>

> [@amaclean](#):
>
> 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.

---

<div class="post-metadata">

### Author: ![amaclean](https://discourse.vtk.org/user_avatar/discourse.vtk.org/amaclean/32/224_2.png) [@amaclean](https://discourse.vtk.org/u/amaclean)
#### Post date: [February 7, 2022, 4:07am UTC](https://discourse.vtk.org/t/setting-path-environment-variables-for-vtk-build-tree-on-windows/7788/3 "2022-02-07T04:07:21Z")

</div>

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?

Regards

---

<div class="post-metadata">

### Author: ![ben.boeckel](https://discourse.vtk.org/letter_avatar_proxy/v4/letter/b/ea5d25/32.png) [@ben.boeckel](https://discourse.vtk.org/u/ben.boeckel)
#### Post date: [February 7, 2022, 1:26pm UTC](https://discourse.vtk.org/t/setting-path-environment-variables-for-vtk-build-tree-on-windows/7788/4 "2022-02-07T13:26:26Z")

</div>

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.

---

<div class="post-metadata">

### Author: ![amaclean](https://discourse.vtk.org/user_avatar/discourse.vtk.org/amaclean/32/224_2.png) [@amaclean](https://discourse.vtk.org/u/amaclean)
#### Post date: [February 8, 2022, 12:14am UTC](https://discourse.vtk.org/t/setting-path-environment-variables-for-vtk-build-tree-on-windows/7788/5 "2022-02-08T00:14:51Z")

</div>

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.
