# Error with io module in Revit2025

**URL:** <https://forum.dynamobim.com/t/error-with-io-module-in-revit2025/110236>\
**Category:** Developers\
**Tags:** python\
**Created:** [May 20, 2025, 11:46am UTC](https://forum.dynamobim.com/t/error-with-io-module-in-revit2025/110236 "2025-05-20T11:46:32Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![Harald](https://avatars.discourse-cdn.com/v4/letter/h/a183cd/32.png) [@Harald](https://forum.dynamobim.com/u/Harald)\
**Post date:** [May 20, 2025, 11:46am UTC](https://forum.dynamobim.com/t/error-with-io-module-in-revit2025/110236/1 "2025-05-20T11:46:33Z")

</div>

I have been using this code for IronPython2 and it works up until Revit 2024 but not in Revit 2025 anymore.

# Load the Python Standard and DesignScript Libraries

import sys  
import clr  
clr.AddReference(‘ProtoGeometry’)  
from Autodesk.DesignScript.Geometry import \*  
from io import StringIO  
sys.stdout = StringIO()

# The inputs to this node will be stored as a list in the IN variables.

dataEnteringNode = IN

The error given is:  
“Importerror: No module named io”

Does anybody know what is the cause of this?

---

<div class="post-metadata">

**Author:** ![Mark.Ackerley](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/mark.ackerley/32/79310_2.png) [@Mark.Ackerley](https://forum.dynamobim.com/u/Mark.Ackerley)\
**Post date:** [May 20, 2025, 2:50pm UTC](https://forum.dynamobim.com/t/error-with-io-module-in-revit2025/110236/2 "2025-05-20T14:50:55Z")

</div>

Not sure about python 2, but it works fine with Cpython3 in Revit 2025?

Just as a test, do you get the same?

Cheers,

Mark

 ![image](https://us1.discourse-cdn.com/flex022/uploads/dynamobim/original/3X/7/f/7f861bb1d058a31e6c5ab6c35f0ff84139713915.png)

---

<div class="post-metadata">

**Author:** ![c.poupin](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/c.poupin/32/89152_2.png) [@c.poupin](https://forum.dynamobim.com/u/c.poupin)\
**Post date:** [May 20, 2025, 8:02pm UTC](https://forum.dynamobim.com/t/error-with-io-module-in-revit2025/110236/3 "2025-05-20T20:02:35Z")

</div>

Hi @Harald

IronPython2.7 is obsolete, it is no longer maintained by the IronPython team, and it is not really sure that it will be compatible with future versions of Net Core 9+ ,

Revit 2025+ marks a new departure (NetCore), and this is an opportunity to migrate to Python3:

- CPython3 (or better PythonNet3)
- IronPython3

---

<div class="post-metadata">

**Author:** ![c.poupin](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/c.poupin/32/89152_2.png) [@c.poupin](https://forum.dynamobim.com/u/c.poupin)\
**Post date:** [May 21, 2025, 7:11am UTC](https://forum.dynamobim.com/t/error-with-io-module-in-revit2025/110236/4 "2025-05-21T07:11:07Z")

</div>

I reported the issue here, with a temporary workaround, but you should still migrate to Python3 (see my previous post)

> <https://github.com/DynamoDS/DSIronPython/issues/17>
>
> Hi,
> 
> 
> 
> \## Dynamo version
> 
> DynamoSanbox 3.4.1
> 
> \## IronPython version 
> 
> 2.7
> 
> \## Dy…namoIronPython2 Package version 
> 
> 3.2.1
> 
> \## Operating system
> 
> Win 10
> 
> \## What did you expect to see?
> 
> IronPython.StdLib is not loaded by default
> 
> !\[Image\](https://github.com/user-attachments/assets/b3f308cf-ba6a-45bc-ada9-03a79b91d6b5)
> 
> \## code to reproduce 
> 
> \`\`\`
> import sys
> import clr
> try:
> import functools
> except Exception as e:
> OUT = e, sys.version, sys.path
> \`\`\`
> 
> \## workaround adding the correct \*\*StdLib path\*\* in \`sys.path\`
> 
> \`\`\`
>      
> import sys
> import clr
> import System
> clr.AddReference("System.Core")
> clr.ImportExtensions(System.Linq)
> \#
> ipy2\_assembly = System.AppDomain.CurrentDomain.GetAssemblies().FirstOrDefault(lambda a : a.GetName().Name == 'IronPython.Modules')
> assembly\_ipy2\_Directory = System.IO.Path.GetDirectoryName( ipy2\_assembly.Location )
> parent\_ipy2\_Directory = System.IO.Directory.GetParent(assembly\_ipy2\_Directory).FullName
> \#
> if System.IO.Directory.Exists(parent\_ipy2\_Directory + "\\\\lib"):
> sys.path.append(parent\_ipy3\_Directory + "\\\\lib")
> if System.IO.Directory.Exists(parent\_ipy2\_Directory + "\\\\extra\\\\lib"):
> sys.path.append(parent\_ipy2\_Directory + "\\\\extra\\\\lib")
> if System.IO.Directory.Exists(parent\_ipy2\_Directory + "\\\\extra"):
> sys.path.append(parent\_ipy2\_Directory + "\\\\extra")
>     
> import functools
> import io                                             
> 
> \`\`\`

---

<div class="post-metadata">

**Author:** ![Harald](https://avatars.discourse-cdn.com/v4/letter/h/a183cd/32.png) [@Harald](https://forum.dynamobim.com/u/Harald)\
**Post date:** [May 21, 2025, 8:40am UTC](https://forum.dynamobim.com/t/error-with-io-module-in-revit2025/110236/5 "2025-05-21T08:40:01Z")

</div>

Yeah, that works with Cpython3.

---

<div class="post-metadata">

**Author:** ![Harald](https://avatars.discourse-cdn.com/v4/letter/h/a183cd/32.png) [@Harald](https://forum.dynamobim.com/u/Harald)\
**Post date:** [May 21, 2025, 9:29am UTC](https://forum.dynamobim.com/t/error-with-io-module-in-revit2025/110236/6 "2025-05-21T09:29:49Z")

</div>

Yeah, if I change it to CPython3 it works.
