# How to install ITK python wheels with Slicer 4.10 and Slicer 4.11?

**URL:** <https://discourse.slicer.org/t/how-to-install-itk-python-wheels-with-slicer-4-10-and-slicer-4-11/12537>\
**Category:** Development\
**Tags:** python, itk-python\
**Created:** [July 14, 2020, 4:44pm UTC](https://discourse.slicer.org/t/how-to-install-itk-python-wheels-with-slicer-4-10-and-slicer-4-11/12537 "2020-07-14T16:44:25Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![siaeleni](https://avatars.discourse-cdn.com/v4/letter/s/b4bc9f/32.png) [@siaeleni](https://discourse.slicer.org/u/siaeleni)\
**Post date:** [July 14, 2020, 4:44pm UTC](https://discourse.slicer.org/t/how-to-install-itk-python-wheels-with-slicer-4-10-and-slicer-4-11/12537/1 "2020-07-14T16:44:25Z")

</div>

Hello,

I have two questions related to itk installation:

1. I want to install itk at 4.10 Slicer version but gives me error:  
Command “python setup.py egg\_info” failed with error code 1 in c:\users\siael\appdata\local\temp\pip-install-law80k\itk\

> from pip.\_internal import main as pipmain  
> pipmain([“install”, “itk”])

1. Is it possible to install a 4.XX version of itk for 4.11 version of Slicer?

Thanks

---

<div class="post-metadata">

**Author:** ![jcfr](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/jcfr/32/17825_2.png) [@jcfr](https://discourse.slicer.org/u/jcfr)\
**Post date:** [July 14, 2020, 6:48pm UTC](https://discourse.slicer.org/t/how-to-install-itk-python-wheels-with-slicer-4-10-and-slicer-4-11/12537/2 "2020-07-14T18:48:13Z")

</div>

> [@siaeleni](#):
>
> I want to install itk at 4.10 Slicer version

Since Slicer 4.10.2 is built against python 2.7, and there no ITK wheels for python 2.7 for latest version of ITK you would have to do this:

```python
from pip._internal import main as pipmain
pipmain(["install", "--no-cache-dir", "itk==4.13.2"])

```

> [@siaeleni](#):
>
> Is it possible to install a 4.XX version of itk for 4.11 version of Slicer?

You could try approach described above.

Out of curiosity, is there something that should be fixed in ITK 5.x ? What motivate the use of an older ITK version ?

---

<div class="post-metadata">

**Author:** ![siaeleni](https://avatars.discourse-cdn.com/v4/letter/s/b4bc9f/32.png) [@siaeleni](https://discourse.slicer.org/u/siaeleni)\
**Post date:** [July 14, 2020, 7:17pm UTC](https://discourse.slicer.org/t/how-to-install-itk-python-wheels-with-slicer-4-10-and-slicer-4-11/12537/3 "2020-07-14T19:17:09Z")

</div>

Hi @jcfr,  
Thanks for the information.

No, there is nothing wrong that I have noticed so far.  
I was wondering if I have a .exe file that I want to execute it through Slicer with different targeting vtk version (8.1.0 instead of 8.2.0), would that be an issue or the versions (itk/vtk) should much always?

Thanks

---

<div class="post-metadata">

**Author:** ![lassoan](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/lassoan/32/13_2.png) [@lassoan](https://discourse.slicer.org/u/lassoan)\
**Post date:** [July 14, 2020, 7:37pm UTC](https://discourse.slicer.org/t/how-to-install-itk-python-wheels-with-slicer-4-10-and-slicer-4-11/12537/4 "2020-07-14T19:37:48Z")

</div>

That should be no problem at all. On Windows, you just need to make sure that if that exe uses VTK or ITK DLLs then those DLLs are in the same folder as the exe file and that the folder is _not_ added to Slicer’s module paths. Rules might be slightly different on Linux and Mac.

---

<div class="post-metadata">

**Author:** ![siaeleni](https://avatars.discourse-cdn.com/v4/letter/s/b4bc9f/32.png) [@siaeleni](https://discourse.slicer.org/u/siaeleni)\
**Post date:** [July 14, 2020, 9:28pm UTC](https://discourse.slicer.org/t/how-to-install-itk-python-wheels-with-slicer-4-10-and-slicer-4-11/12537/5 "2020-07-14T21:28:23Z")

</div>

If by term Slicer’s module path you mean the “Additional module path” under Application Settings, then no. Thanks Andras!

---

<div class="post-metadata">

**Author:** ![lassoan](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/lassoan/32/13_2.png) [@lassoan](https://discourse.slicer.org/u/lassoan)\
**Post date:** [July 14, 2020, 9:43pm UTC](https://discourse.slicer.org/t/how-to-install-itk-python-wheels-with-slicer-4-10-and-slicer-4-11/12537/6 "2020-07-14T21:43:33Z")

</div>

Yes, I meant standard module paths (within Slicer install folder) and any additional module paths that you specify in application settings.

---

<div class="post-metadata">

**Author:** ![siaeleni](https://avatars.discourse-cdn.com/v4/letter/s/b4bc9f/32.png) [@siaeleni](https://discourse.slicer.org/u/siaeleni)\
**Post date:** [July 16, 2020, 2:30am UTC](https://discourse.slicer.org/t/how-to-install-itk-python-wheels-with-slicer-4-10-and-slicer-4-11/12537/7 "2020-07-16T02:30:22Z")

</div>

Hello again,

I am trying to install itk 4.13.0 version on Slicer 4.11 (2020-06-24) but I get the following error:

> > > > from pip._internal import main as pipmain  
> > > > pipmain([“install”, “–no-cache-dir”, “itk==4.13.0”])  
> > > > WARNING: pip is being invoked by an old script wrapper. This will fail in a future version of pip.  
> > > > Please see [ImportError in system pip wrappers after an upgrade · Issue #5599 · pypa/pip · GitHub](https://github.com/pypa/pip/issues/5599) for advice on fixing the underlying issue.  
> > > > To avoid this problem you can invoke Python with ‘-m pip’ instead of running pip directly.  
> > > > Traceback (most recent call last):  
> > > > File “”, line 1, in   
> > > > File "C:\ProgramData\NA-MIC\Slicer 4.11.0-2020-06-24\lib\Python\Lib\site-packages\pip\_internal\_init_.py", line 17, in main  
> > > > return _wrapper(args)  
> > > > File “C:\ProgramData\NA-MIC\Slicer 4.11.0-2020-06-24\lib\Python\Lib\site-packages\pip\_internal\utils\entrypoints.py”, line 31, in wrapper  
> > > > return main(args)  
> > > > File “C:\ProgramData\NA-MIC\Slicer 4.11.0-2020-06-24\lib\Python\Lib\site-packages\pip\_internal\cli\main.py”, line 73, in main  
> > > > command = create\_command(cmd\_name, isolated=(“–isolated” in cmd\_args))  
> > > > File "C:\ProgramData\NA-MIC\Slicer 4.11.0-2020-06-24\lib\Python\Lib\site-packages\pip\_internal\commands\_init.py", line 104, in create\_command  
> > > > module = importlib.import\_module(module\_path)  
> > > > File "C:\ProgramData\NA-MIC\Slicer 4.11.0-2020-06-24\lib\Python\Lib\importlib\_init_.py", line 126, in import\_module  
> > > > return \_bootstrap.\_gcd\_import(name[level:], package, level)  
> > > > File “”, line 994, in \_gcd\_import  
> > > > File “”, line 971, in \_find\_and\_load  
> > > > File “”, line 955, in \_find\_and\_load\_unlocked  
> > > > File “”, line 665, in \_load\_unlocked  
> > > > File “”, line 678, in exec\_module  
> > > > File “”, line 219, in \_call\_with\_frames\_removed  
> > > > File “C:\ProgramData\NA-MIC\Slicer 4.11.0-2020-06-24\lib\Python\Lib\site-packages\pip\_internal\commands\install.py”, line 24, in   
> > > > from pip.\_internal.cli.req\_command import RequirementCommand, with\_cleanup  
> > > > File “C:\ProgramData\NA-MIC\Slicer 4.11.0-2020-06-24\lib\Python\Lib\site-packages\pip\_internal\cli\req\_command.py”, line 16, in   
> > > > from pip.\_internal.index.package\_finder import PackageFinder  
> > > > File “C:\ProgramData\NA-MIC\Slicer 4.11.0-2020-06-24\lib\Python\Lib\site-packages\pip\_internal\index\package\_finder.py”, line 21, in   
> > > > from pip.\_internal.index.collector import parse\_links  
> > > > File “C:\ProgramData\NA-MIC\Slicer 4.11.0-2020-06-24\lib\Python\Lib\site-packages\pip\_internal\index\collector.py”, line 25, in   
> > > > from pip._internal.vcs import is\_url, vcs  
> > > > File "C:\ProgramData\NA-MIC\Slicer 4.11.0-2020-06-24\lib\Python\Lib\site-packages\pip\_internal\vcs\_init_.py", line 9, in   
> > > > import pip.\_internal.vcs.subversion # noqa: F401  
> > > > File “C:\ProgramData\NA-MIC\Slicer 4.11.0-2020-06-24\lib\Python\Lib\site-packages\pip\_internal\vcs\subversion.py”, line 334, in   
> > > > vcs.register(Subversion)  
> > > > File “C:\ProgramData\NA-MIC\Slicer 4.11.0-2020-06-24\lib\Python\Lib\site-packages\pip\_internal\vcs\versioncontrol.py”, line 221, in register  
> > > > self.\_registry[cls.name] = cls()  
> > > > File “C:\ProgramData\NA-MIC\Slicer 4.11.0-2020-06-24\lib\Python\Lib\site-packages\pip\_internal\vcs\subversion.py”, line 192, in **init**  
> > > > use\_interactive = is\_console\_interactive()  
> > > > File “C:\ProgramData\NA-MIC\Slicer 4.11.0-2020-06-24\lib\Python\Lib\site-packages\pip\_internal\utils\misc.py”, line 875, in is\_console\_interactive  
> > > > return sys.stdin is not None and sys.stdin.isatty()  
> > > > AttributeError: ‘PythonQtStdInRedirect’ object has no attribute ‘isatty’

Do you have any idea?

Thanks

---

<div class="post-metadata">

**Author:** ![lassoan](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/lassoan/32/13_2.png) [@lassoan](https://discourse.slicer.org/u/lassoan)\
**Post date:** [July 16, 2020, 3:08am UTC](https://discourse.slicer.org/t/how-to-install-itk-python-wheels-with-slicer-4-10-and-slicer-4-11/12537/8 "2020-07-16T03:08:05Z")

</div>

I don’t know how exactly ITK Python package is created, but since ITK is already bundled with Slicer, if you install a different version in side Slicer’s environment then there could be version conflicts. You have several options:

- don’t use old ITK, simply use current version: `pip_install('itk')`
- install old ITK in a different Python virtual environment, not in Slicer’s
- use SimpleITK bundled with Slicer
