# Is anything blocking the removal of Python2 support from VTK?

**URL:** https://discourse.vtk.org/t/is-anything-blocking-the-removal-of-python2-support-from-vtk/10468
**Category:** Development
**Tags:** python, code, proposal
**Created:** [January 16, 2023, 1:12pm UTC](https://discourse.vtk.org/t/is-anything-blocking-the-removal-of-python2-support-from-vtk/10468 "2023-01-16T13:12:58Z")
**Posts on this page:** 8
**Page:** 1

<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: [January 16, 2023, 1:12pm UTC](https://discourse.vtk.org/t/is-anything-blocking-the-removal-of-python2-support-from-vtk/10468/1 "2023-01-16T13:12:58Z")

</div>

Is anyone aware of blockers to removing Python2 support from VTK? It has been deprecated since 9.1.0, untested for…a long time, and has been EOL itself for 3 years now.

Things removing Python2 support gets us:

- around 1400 lines removed from the codebase
- allows us to pursue stable ABI usage in our Python bindings (which will allow for a single wheel for 3.11+ support; maybe also PyPy support from our wheels?)
- removing a gap in our CI coverage

I am _not_ proposing to increase our minimum supported Python3 version above 3.6 (3.4+ is claimed, but untested and hidden if `VTK_LEGACY_REMOVE` is set).

Thoughts?

–Ben

---

<div class="post-metadata">

### Author: ![fab672000](https://discourse.vtk.org/user_avatar/discourse.vtk.org/fab672000/32/5808_2.png) [@fab672000](https://discourse.vtk.org/u/fab672000)
#### Post date: [January 16, 2023, 2:44pm UTC](https://discourse.vtk.org/t/is-anything-blocking-the-removal-of-python2-support-from-vtk/10468/2 "2023-01-16T14:44:17Z")

</div>

+1 It makes sense to remove it to me, if an old app still uses python2, it can still use previous VTK versions or port the code to 3.11+

---

<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: [January 16, 2023, 2:56pm UTC](https://discourse.vtk.org/t/is-anything-blocking-the-removal-of-python2-support-from-vtk/10468/3 "2023-01-16T14:56:58Z")

</div>

> [@fab672000](#):
>
> or port the code to 3.11+

Just to be clear, I’m not proposing a bump to Python 3.11 for Python3 support (yet…). That would definitely dropping support for known users, so isn’t being considered at this time.

---

<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: [January 17, 2023, 8:05pm UTC](https://discourse.vtk.org/t/is-anything-blocking-the-removal-of-python2-support-from-vtk/10468/4 "2023-01-17T20:05:39Z")

</div>

Proposed MR: [https://gitlab.kitware.com/vtk/vtk/-/merge\_requests/9858](https://gitlab.kitware.com/vtk/vtk/-/merge_requests/9858)

---

<div class="post-metadata">

### Author: ![hakostra](https://discourse.vtk.org/user_avatar/discourse.vtk.org/hakostra/32/2990_2.png) [@hakostra](https://discourse.vtk.org/u/hakostra)
#### Post date: [January 18, 2023, 9:07am UTC](https://discourse.vtk.org/t/is-anything-blocking-the-removal-of-python2-support-from-vtk/10468/5 "2023-01-18T09:07:40Z")

</div>

Sounds like a very good idea, +1!

---

<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: [January 25, 2023, 2:07pm UTC](https://discourse.vtk.org/t/is-anything-blocking-the-removal-of-python2-support-from-vtk/10468/6 "2023-01-25T14:07:18Z")

</div>

If there is no objection, we can remove it with the above MR (and revert if someone _really_ needs Python2 and has the means to aid in supporting it longer-term). We’d need CI for it if it does come back (since at that point someone cares enough).

Any objection to Jan 31st as a planned merge date?

---

<div class="post-metadata">

### Author: ![dgobbi](https://discourse.vtk.org/user_avatar/discourse.vtk.org/dgobbi/32/18_2.png) [@dgobbi](https://discourse.vtk.org/u/dgobbi)
#### Post date: [January 25, 2023, 4:01pm UTC](https://discourse.vtk.org/t/is-anything-blocking-the-removal-of-python2-support-from-vtk/10468/7 "2023-01-25T16:01:36Z")

</div>

Speaking as a maintainer, I have no objections. I recently upgraded my linux system and it no longer has Python2, my other systems are likely to follow soon. People who need Python2 will be able to continue using VTK 9.2.

---

<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: [January 31, 2023, 3:00pm UTC](https://discourse.vtk.org/t/is-anything-blocking-the-removal-of-python2-support-from-vtk/10468/8 "2023-01-31T15:00:47Z")

</div>

I’ll merge the MR here soon. Reverting it with CI added to verify it will be the way to restore it.
