# How to update from Python 2.7 to 3.7?

**URL:** https://discourse.slicer.org/t/how-to-update-from-python-2-7-to-3-7/11443
**Category:** Support
**Created:** [May 7, 2020, 1:07pm UTC](https://discourse.slicer.org/t/how-to-update-from-python-2-7-to-3-7/11443 "2020-05-07T13:07:29Z")
**Posts on this page:** 9
**Page:** 1

<div class="post-metadata">

### Author: ![katjx](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/katjx/32/6773_2.png) [@katjx](https://discourse.slicer.org/u/katjx)
#### Post date: [May 7, 2020, 1:07pm UTC](https://discourse.slicer.org/t/how-to-update-from-python-2-7-to-3-7/11443/1 "2020-05-07T13:07:30Z")

</div>

Hi!  
I 'm very new with DICOM images processing and with Python  
I have **3DSlicer version 4.10.2** installed and the Python version I see in Python Interactor is:

> Python 2.7.13 (default, May 16 2019, 14:27:45) [MSC v.1900 64 bit (AMD64)] on win32

Is there a way to upgrade to Python 3.7?

The original reason for wanting to do this is because when trying to load DICOM files I get the following error:

> DICOM Plugin failed: ‘module’ object has no attribute ‘TemporaryDirectory’

and from what I 've read, an upgrade to python 3.7 may solve the problem

Thank you

---

<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: [May 7, 2020, 1:41pm UTC](https://discourse.slicer.org/t/how-to-update-from-python-2-7-to-3-7/11443/2 "2020-05-07T13:41:11Z")

</div>

Slicer-4.11 uses Python 3. It also has a greatly improved DICOM browser. See examples in [script repository](https://www.slicer.org/wiki/Documentation/Nightly/ScriptRepository) to see how you can manage DICOM files.

---

<div class="post-metadata">

### Author: ![katjx](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/katjx/32/6773_2.png) [@katjx](https://discourse.slicer.org/u/katjx)
#### Post date: [May 7, 2020, 6:15pm UTC](https://discourse.slicer.org/t/how-to-update-from-python-2-7-to-3-7/11443/3 "2020-05-07T18:15:32Z")

</div>

I have downloaded and installed Slicer-4.11, but still getting errors like the following and couldn’t load any DICOM file yet.

 ![image](https://us1.discourse-cdn.com/flex002/uploads/slicer/original/3X/7/e/7ec0c822de63bd968efbc4fb51fbb3e39467cd7d.png)

Thanks anyway!

---

<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: [May 7, 2020, 6:26pm UTC](https://discourse.slicer.org/t/how-to-update-from-python-2-7-to-3-7/11443/4 "2020-05-07T18:26:57Z")

</div>

That means that your DICOM files are corrupted. What software created them?

---

<div class="post-metadata">

### Author: ![katjx](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/katjx/32/6773_2.png) [@katjx](https://discourse.slicer.org/u/katjx)
#### Post date: [May 7, 2020, 7:48pm UTC](https://discourse.slicer.org/t/how-to-update-from-python-2-7-to-3-7/11443/5 "2020-05-07T19:48:29Z")

</div>

I only have the information from the file’s metadata, so I can see the following:  
Source Application Entity Title: ECHOPAC  
Manufacturer: GE Vingmed Ultrasound  
Manufacturer’s Model Name: EchoPAC PC SW-Only

---

<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: [May 7, 2020, 9:58pm UTC](https://discourse.slicer.org/t/how-to-update-from-python-2-7-to-3-7/11443/6 "2020-05-07T21:58:43Z")

</div>

You may try running the image through DICOM patcher module to see if that can fix the format error.

Could you provide a sample image file (must not contain patient information; preferably an original scan of any object, not a patient)?

---

<div class="post-metadata">

### Author: ![katjx](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/katjx/32/6773_2.png) [@katjx](https://discourse.slicer.org/u/katjx)
#### Post date: [May 8, 2020, 7:15am UTC](https://discourse.slicer.org/t/how-to-update-from-python-2-7-to-3-7/11443/7 "2020-05-08T07:15:46Z")

</div>

I run the DICOM patcher on the data and then, when I tried to import, I got the following errors and couldn’t import the data:

 ![Untitled](https://us1.discourse-cdn.com/flex002/uploads/slicer/original/3X/d/e/de75f679b0492556f6a3779280134c411d96477f.png)

Unfortunately I’m not allowed to publish the files, even anonymized, and I don’t have access to the machine to get a new scan of an object.

---

<div class="post-metadata">

### Author: ![pieper](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/pieper/32/8_2.png) [@pieper](https://discourse.slicer.org/u/pieper)
#### Post date: [May 8, 2020, 12:09pm UTC](https://discourse.slicer.org/t/how-to-update-from-python-2-7-to-3-7/11443/8 "2020-05-08T12:09:01Z")

</div>

It looks like your files are pretty badly formatted or maybe corrupted by some processing step. Since you can’t share them, a good path would be for you would be to study up on dicom. There are tons of books and web pages. Also try the [analyze tab on the innolitics site](https://dicom.innolitics.com) to better understand what’s going on inside.

---

<div class="post-metadata">

### Author: ![katjx](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/katjx/32/6773_2.png) [@katjx](https://discourse.slicer.org/u/katjx)
#### Post date: [May 8, 2020, 1:16pm UTC](https://discourse.slicer.org/t/how-to-update-from-python-2-7-to-3-7/11443/9 "2020-05-08T13:16:40Z")

</div>

I will. Thank you for your answers!
