Python engine automatically updating to CPython3

It seems 2.13 is changing all python nodes to 3. is there a setting to keep them as 2.7 instead of relying on people to update their packages for nodes to work again?

You can install the IronPython 2 package to keep things working, but best to convert what you can as you can to CPython 3 to prevent security issues down the line.

The graphs I shared in the other thread shoudl give you some tools to bulk update and test the updated graphs.

It let’s it work but dosnt change the automatic change to 3 :slightly_frowning_face:

Nodes shouldn’t be automatically changing to three - did you accidentally run an upgrade tool on it?

I don’t think so. Just copied the scripts and packages then opened in 2.13. Then noticed nodes wernt working. Then went inside and they were python 3. Then copied the python in the node out into the graph and changed to python 2.7 and worked

Hi,
probably because Python custom nodes syntax is XML (old structure) instead of JSON

So a Dynamo 1.x upgrade to 2.13 pushes the engine to CPytthon 3? Does this reproduce (literally shut down the laptop 2 seconds ago or I’d check myself)?

yes :roll_eyes:

2 Likes

Split this to a new topic as it feels important enough to track/watch separately.

1 Like

The Bulk Python Engine updater in the ZIP I posted here can certainly be revised to allow the bulk downgrade to IronPython from CPython. Filing this one as one more reason to upgrade graphs in your library at each release.

1 Like

I don’t think it’s so simple by editing the dyn, (you need to convert from XML to JSON format)

it would be easier to handle this directly in DynamoServices library
if IsXmlContent(dyffile) → use IronPython2 engine

@Michael_Kirschner2 do you think it’s possible ?

1 Like

I don’t have my laptop but I think the node was dynamo 2 somthing but I’ll have to double check tomorrow. Will try reverse script too

How do you do this? Would you be able to deploy the settings to other people?

It’s just an idea for DynamoTeam

This was for already updated graphs.

1 Like

so I think theres 2.5 issues here

  1. a bug - that somehow opening an xml based graph in 2.13 and later will force python engine to version cpython3 - I think this is a bug… very little chance of this working - so if it was by design, not a great one.

  2. You are looking for some solution to fix graphs that have been effected by this bug and saved in json.

2a. You are looking for a solution to not change the python engine version when opening these files - in already released version of Dynamo (2.13) - hard.

4 Likes

That’s rough. Hopes and prers it’s not affecting to many graphs. Or any custom nodes I can’t get into :scream:

Could we get a patch or something? Isn’t this quite major?

I wonder if I didn’t have the python 2.7 package installed before opening dynamo the first time it might not switch the nodes to python 3?

I haven’t seen this at scale other then what you’re posting; Dynamo 1.3 stopped being officially supported about 9 months ago when 2019 stopped being supported. If you’ve done any work in 2020, 2021, and 2022 the graphs would have updated from XML to JSON then there isn’t any XML to update to JSON and the default python engine wouldn’t be an issue.

Incremental upgrades of your library and ensuring you’re on current packages should prevent the issue, but it’s likely you’re too far along for that now.

Got slightly lost in that. However a legend script I made was done in 2022 and upgraded to 2023 and the python engine was changed in a node. Sorry not sure if you obviously stated that. The XML to JSON is out of my understanding