# Upgrading Python

**URL:** <https://forum.dynamobim.com/t/upgrading-python/92159>\
**Category:** Uncategorized\
**Created:** [July 25, 2023, 10:53am UTC](https://forum.dynamobim.com/t/upgrading-python/92159 "2023-07-25T10:53:30Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![Sigma](https://avatars.discourse-cdn.com/v4/letter/s/dec6dc/32.png) [@Sigma](https://forum.dynamobim.com/u/Sigma)\
**Post date:** [July 25, 2023, 10:53am UTC](https://forum.dynamobim.com/t/upgrading-python/92159/1 "2023-07-25T10:53:30Z")

</div>

Hi everyone,

It has been a very long time since I have posted and indeed since I have used Dynamo.  
I am currently working in Dynamo Revit 2.16.1.6510 and Revit 2023.1.

I have created a super basic script using the latest versions of Orchid, Data-Shapes and clockwork.

I know the upgrade went from 2 to 3, but how do I modify these Python nodes to get them to work with the script? I thought that the updated packages would contain python 3 but it appears they dont.  
Here is the script I put together just to test

 ![image](https://us1.discourse-cdn.com/flex022/uploads/dynamobim/original/3X/0/8/086e3fb6cb33a74e99158460e4c61e0529bb5456.png)

When I save the file and reopen, this is the message I get:  
 ![image](https://us1.discourse-cdn.com/flex022/uploads/dynamobim/original/3X/2/a/2a811521eb47d29383a9bbb8d1316ea535b30466.png)

When I install the requested IronPython2 dependency, nothing happens. I’m just a little unsure of the process now days if someone could point me in the right direction I would appreciate that.

thanks a lot!

---

<div class="post-metadata">

**Author:** ![Draxl\_Andreas](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/draxl_andreas/32/145744_2.png) [@Draxl\_Andreas](https://forum.dynamobim.com/u/Draxl_Andreas)\
**Post date:** [July 25, 2023, 11:10am UTC](https://forum.dynamobim.com/t/upgrading-python/92159/2 "2023-07-25T11:10:04Z")

</div>

@Sigma ,

you can download it from the package manager both

Ironpython2

Ironpython3

 ![grafik](https://us1.discourse-cdn.com/flex022/uploads/dynamobim/original/3X/1/1/111813352ab6a360640c96357496950dfbfad139.png)

KR

Andreas

---

<div class="post-metadata">

**Author:** ![Sigma](https://avatars.discourse-cdn.com/v4/letter/s/dec6dc/32.png) [@Sigma](https://forum.dynamobim.com/u/Sigma)\
**Post date:** [July 25, 2023, 11:17am UTC](https://forum.dynamobim.com/t/upgrading-python/92159/3 "2023-07-25T11:17:34Z")

</div>

Hi @Draxl_Andreas

Thanks, I do currently have them both installed, but when I run nothing happens, just blanks across the board. Anything else that it could be?

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

---

<div class="post-metadata">

**Author:** ![Draxl\_Andreas](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/draxl_andreas/32/145744_2.png) [@Draxl\_Andreas](https://forum.dynamobim.com/u/Draxl_Andreas)\
**Post date:** [July 25, 2023, 11:30am UTC](https://forum.dynamobim.com/t/upgrading-python/92159/4 "2023-07-25T11:30:48Z")

</div>

@Sigma ,

seems to be in the clockwork node…

…data-shapes works well i got GUIs

 ![grafik](https://us1.discourse-cdn.com/flex022/uploads/dynamobim/original/3X/e/e/ee6cb8067188cab7f1076f1d5f2e922969a00285.png)  
 ![2023-07-25_13h28_18](https://us1.discourse-cdn.com/flex022/uploads/dynamobim/original/3X/3/d/3df2102fadc4b67c0e3f929a35daf6ad95216e76.png)

thats the code…

```auto
import System
import clr
clr.AddReference('RevitAPI')
from Autodesk.Revit.DB import *
import Autodesk

clr.AddReference("RevitNodes")
import Revit
clr.ImportExtensions(Revit.Elements)

clr.AddReference("RevitServices")
import RevitServices
from RevitServices.Persistence import DocumentManager

inputdoc = UnwrapElement(IN[1])
if inputdoc == None:
	doc = DocumentManager.Instance.CurrentDBDocument
elif inputdoc.GetType().ToString() == "Autodesk.Revit.DB.RevitLinkInstance":
	doc = inputdoc.GetLinkDocument()
elif inputdoc.GetType().ToString() == "Autodesk.Revit.DB.Document":
	doc = inputdoc
else: doc = None
version = IN[2]

names = []
cats = []
vag = []
pgs = []
pts = []
uts = []
isvis = []
elems = []
guids = []
isinst = []
bics = []
iterator = doc.ParameterBindings.ForwardIterator()
while iterator.MoveNext():
	vag.append(iterator.Key.VariesAcrossGroups)
	names.append(iterator.Key.Name)
	pgs.append(iterator.Key.ParameterGroup)
	if version > 2021: 
		pts.append(iterator.Key.GetDataType())
		uts.append(iterator.Key.GetDataType())
	else: 
		pts.append(iterator.Key.ParameterType)
		uts.append(iterator.Key.UnitType)
	isvis.append(iterator.Key.Visible)
	elem = doc.GetElement(iterator.Key.Id)
	elems.append(elem)
	if elem.GetType().ToString() == 'Autodesk.Revit.DB.SharedParameterElement':
		guids.append(elem.GuidValue)
	else: guids.append(None)
	if iterator.Current.GetType().ToString() == 'Autodesk.Revit.DB.InstanceBinding':
		isinst.append(True)
	else:
		isinst.append(False)
	thesecats = []
	builtincats = []
	for cat in iterator.Current.Categories:
		try:
			thesecats.append(Revit.Elements.Category.ById(cat.Id.IntegerValue))
		except:
			# Return null if category is not supported by Dynamo
			# This way the user knows there are unsupported categories assigned
			thesecats.append(None)
		builtincats.append(System.Enum.ToObject(BuiltInCategory, cat.Id.IntegerValue))
	cats.append(thesecats)
	bics.append(builtincats)
OUT = (names,cats,vag, pgs, pts, uts, isvis, elems, guids, isinst, bics)

```

KR

Andreas

---

<div class="post-metadata">

**Author:** ![Sigma](https://avatars.discourse-cdn.com/v4/letter/s/dec6dc/32.png) [@Sigma](https://forum.dynamobim.com/u/Sigma)\
**Post date:** [July 25, 2023, 11:44am UTC](https://forum.dynamobim.com/t/upgrading-python/92159/5 "2023-07-25T11:44:16Z")

</div>

Thanks so much, you’re right, it’s something to do with the clockwork node.  
I replaced it with an Orchid one for now to at least get the data, thanks for that.

 ![image](https://us1.discourse-cdn.com/flex022/uploads/dynamobim/original/3X/6/9/69380a6fa87751edc76b297f897d1847db53d43a.png)

---

<div class="post-metadata">

**Author:** ![PBO](https://avatars.discourse-cdn.com/v4/letter/p/8e8cbc/32.png) [@PBO](https://forum.dynamobim.com/u/PBO)\
**Post date:** [October 19, 2023, 8:16am UTC](https://forum.dynamobim.com/t/upgrading-python/92159/6 "2023-10-19T08:16:29Z")

</div>

Hi, Andreas. Is it enough though to install the python packages? I got this weird issue with Genius Loci package which used to worked perfectly, now some nodes do, others don’t. Related to Legend Component, I used it the Create Legend Component effortlessly in previous versions, now it stopped working. I switched manually the python version and ran the utility, but still nothing. The only Legend Component related node from GL that I could still use as a workaround method (use a template of legend and just switch the types) is Select by View. However, this node is still using Python 2, I haven’t updated it yet. So what other methods to update to the newest Python for all packages are there? For example Genius Loci is the latest version so I didn’t even think it needs updating. What am I doing wrong? Hope this is not too all over the place and explanation. Thanks in advance!

 ![image](https://us1.discourse-cdn.com/flex022/uploads/dynamobim/original/3X/9/1/91564d4c5e1639304267481990de90833589cfb1.png)

---

<div class="post-metadata">

**Author:** ![Alban\_de\_Chasteigner](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/alban_de_chasteigner/32/39650_2.png) [@Alban\_de\_Chasteigner](https://forum.dynamobim.com/u/Alban_de_Chasteigner)\
**Post date:** [October 19, 2023, 8:30am UTC](https://forum.dynamobim.com/t/upgrading-python/92159/7 "2023-10-19T08:30:38Z")

</div>

> [@PBO](#):
>
> Is it enough though to install the python packages? I got this weird issue with Genius Loci package which used to worked perfectly, now some nodes do, others don’t.

Hi,  
I confirm that it is enough to install the DynamoIronPython2.7 package for the _Genius Loci_ package nodes to work normally. You don’t have to take any editing action.

---

<div class="post-metadata">

**Author:** ![PBO](https://avatars.discourse-cdn.com/v4/letter/p/8e8cbc/32.png) [@PBO](https://forum.dynamobim.com/u/PBO)\
**Post date:** [October 19, 2023, 9:20am UTC](https://forum.dynamobim.com/t/upgrading-python/92159/8 "2023-10-19T09:20:57Z")

</div>

Good old package reinstall did the trick, apollogies for reopening the subject.
