Python 2.7 in Dynamo 2.13

Hi
I am playing around with Dynamo 2.13 in Revit 2023 and I saw that we should still be able to switch between CPython3 and Iron Python 2.7 provided we install the latter from the package manager.
However Iron Python 2.7 doesn’t appear as an option for me, even after restarting Revit.
What am I missing here?

@viktor_kuzev you should be able to switch between Python engines for sure. Did you try a restart after package install?

FYI @Michael_Kirschner2

When I wrote the post I had only restarted Revit.
Now I did full reboot of the PC, but I can still only use CPython3.
edit:
I uninstalled it, installed again and still the same

1 Like

Hi @viktor_kuzev
I think you have installed the wrong package
Uninstall ‘DynamoIronPython2.7’, restart Revit , then install ‘DSIronPython2.7’
EDIT : see answers below

DynamoIronPython2.7 should be for later versions of Dynamo, with DSIronPython2.7 for earlier versions (I know, it’s not super obvious :pleading_face:)

Edit: Refer to @Michael_Kirschner2 's notes below.

2 Likes

DSIronPython2.7 package is actually deprecated - I’m not sure why it shows in your search - seems like a bug @solamour.

I think DynamoIronPython2.7 is the package to use, and latest version should be good, but you can try an earlier one as well, like 2.3. I would expect 2.4 to be the correct version though.

Please attach or send your logs or scan them for any python or package related errors.

3 Likes

if you open a graph with a node that uses ironPython, it is indeed this package, and v 2.4 that is added as a dep of that graph to the workspace references window.

4 Likes

Checking the logs now, but I don’t see any errors. (None of the other suggestions seemed to have any effect on the issue)
These are the only 3 lines concerning Python (now that I have installed DynamoIronPython 2.7):

Python template set to default.
IronPythonExtension (id: D7B449D7-4D54-47EF-B742-30C7BEDFBE92) extension is added
Python Migration (id: 1f8146d0-58b1-4b3c-82b7-34a3fab5ac5d) view extension is added

dynamoLog_8c172701-787c-4839-af8b-18bbafdb3599.txt (5.7 KB)

Try this way (with Dynamo 2.12 or above to create a simple Python node and re-open it in Dynamo 2.13+)

install Ipy2

Curiously, installing the Ipy2 Package seems finicky (slow) today, need several regenerate…

could you please verify where the DynamoIronPython package has been installed?

@viktor_kuzev - Mike and I have reproduced this process, and think we have a solution. Can you please try the following steps?

  1. Remove any current DynamoIronPython2.7 package you may have installed from your %appdata% folder:

    a. Navigate to C:\Users\<yourUserNameGoesHere>\AppData\Roaming\Dynamo\Dynamo Revit\2.13\packages and ensure that you replace my username amours with yours :slight_smile:
    b. Delete the package

image

  1. After you have deleted the package, please try and install the 2.1.0 version from the View Details entry point to get to the Package Details.
    a. Click on View Details on the DynamoIronPython2.7 package under Search for Packages
    b. Navigate down to the Versions and Package Requirements section.
    c. Install version 2.1.0 - as shown installed on my machine.

This should again grant you access to IronPython - and we’ll be updating the package to reflect this in it’s description shortly.

Alternatively, if you have a graph with a package that uses IronPython2.7, when opening you should get the Workspace References automatically pop-up. From here, you can install IronPython2.7 directly and it should be the correct, working version.

Missing IronPython2.7 dependency:

Correctly working IronPython2.7 after install from Workspace References:

3 Likes

Thanks! That did the trick for me.
Thanks for taking your time with that

2 Likes

Awesome, glad to hear it! We’re looking at updating and fixing the package now so that others don’t run into the same problem :slight_smile:

1 Like

7 posts were split to a new topic: Python engine automatically updating

A post was merged into an existing topic: Python engine automatically updating

Have not tested this out yet on 2023. Will Dynamo Packages and Scripts created in 2.16 work in the previous versions of Dynamo? So if I update my scripts to work in Revit 2023, and I path those same packages in Dynamo 2.12 and 2.6 will they still work? Maybe this is what the forum in about, but I didn’t quite follow all the post. Thanks

@jtmiller this specifically refers to the Python implementation IronPython2, so no nodes beyond the Python node are affected :slight_smile:

We introduce a new Python engine, CPython3 to Dynamo that enabled a switch, so you as user can choose either CPython3 or IronPython2, and converted IronPython into a package due to security reasons (So you, as a user have to opt into using it knowing said security flaws and accepting them).

This means you can totally still create Python scripts in IronPython2 (If you have the package installed) that are fully backwards compatible in the same ways as before. CPython3 uses Python 3 instead of Python 2 where syntax has changed, so that is not backwards compatible.

@solamour ,
Is it possible to create an IronPython 3.4 package, like IronPython 2.7? Thanks!

We’re looking at this soon :blush: No timelines as we have a couple of big things underway right now, but we do want to.

2 Likes