# Note on python dependencies

**URL:** https://discourse.slicer.org/t/note-on-python-dependencies/20202
**Category:** Development
**Tags:** python
**Created:** [October 18, 2021, 10:15am UTC](https://discourse.slicer.org/t/note-on-python-dependencies/20202 "2021-10-18T10:15:24Z")
**Posts on this page:** 2
**Page:** 1

<div class="post-metadata">

### Author: ![Alex\_Vergara](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/alex_vergara/32/15205_2.png) [@Alex\_Vergara](https://discourse.slicer.org/u/Alex_Vergara)
#### Post date: [October 18, 2021, 10:15am UTC](https://discourse.slicer.org/t/note-on-python-dependencies/20202/1 "2021-10-18T10:15:24Z")

</div>

This note is for python extension developers.

With the introduction of setuptools==58 in the [Slicer pull 5925](https://github.com/Slicer/Slicer/pull/5925) all dependencies that rely on 2to3 libraries are totally broken as discussed in several python packages like [jsmin](https://github.com/tikitu/jsmin/pull/34), [simpleeval](https://github.com/danthedeckie/simpleeval/issues/90), etc.

This will lead to errors in CDash as [this one](https://slicer.cdash.org/test/19771184) that will prevent you from building your extensions. You will not be able to update anymore your extensions if you depend on some package that fall into this issue, as you will not control slicer setuptools package (you can’t downgrade it).

The ONLY solution is to remove all your dependencies to those obsolete packages and find alternative solutions. Some of those packages has been unmantained for a long time.

---

<div class="post-metadata">

### Author: ![jamesobutler](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/jamesobutler/32/7511_2.png) [@jamesobutler](https://discourse.slicer.org/u/jamesobutler)
#### Post date: [October 18, 2021, 1:49pm UTC](https://discourse.slicer.org/t/note-on-python-dependencies/20202/2 "2021-10-18T13:49:37Z")

</div>

Yes you will need to begin using packages that have been appropriately ported to python 3 and don’t rely on lib2to3. I would encourage you to update to latest versions of packages that work with the latest setuptools. Including upgrading syntax or choosing a different package that has been maintained for the modern python future.

In the python documentation [2to3 — Automated Python 2 to 3 code translation — Python 3.12.1 documentation](https://docs.python.org/3/library/2to3.html#module-lib2to3) it details that lib2to3 is marked as fully deprecated with Python 3.11 and will be removed from the standard library in a few versions.

Slicer will be moving to the latest Python version soon as packages have already dropped python 3.6 and even 3.7 support.

> Python 3.10 includes new language syntax that is not parsable by lib2to3’s LL(1) parser
