Python engine could not found

HI… I am trying to run a python script in Dynamo, I am facing trouble in running it. The error shows as PYTHON ENGINE COULDN’T FOUND

Hi @Arunkumar.Palanisamy,
If you are in Dynamo 2.13, you need to install the IronPython2.7 package.
Only the CPython3 engine is installed by default.

4 Likes

Hi @Alban_de_Chasteigner ,
i have installed that IronPython 2.7 version but still facing the same error.

@Arunkumar.Palanisamy ,

hi, Do you also import your library?

KR

Andreas

In Revit 2022, IronPython 2.7 is OOTB (include with Dynamo) which version did you install?

Hi @Draxl_Andreas,
I have the same issue as @Arunkumar.Palanisamy. What do you mean by import the library? Which library and where to import it?
Thanks in advance!

1 Like

@denes.nagy ,

for running you scripts you need the correct framing
https://primer.dynamobim.org/10_Custom-Nodes/10-6_Python-Templates.html
i do always copy/paste this inviroment.

import clr

clr.AddReference('RevitAPI')
from Autodesk.Revit.DB import *
from Autodesk.Revit.DB.Structure import *

clr.AddReference('RevitAPIUI')
from Autodesk.Revit.UI import *

clr.AddReference('System')
from System.Collections.Generic import List

clr.AddReference('RevitNodes')
import Revit
clr.ImportExtensions(Revit.GeometryConversion)
clr.ImportExtensions(Revit.Elements)

clr.AddReference('RevitServices')
import RevitServices
from RevitServices.Persistence import DocumentManager
from RevitServices.Transactions import TransactionManager

doc = DocumentManager.Instance.CurrentDBDocument
uidoc=DocumentManager.Instance.CurrentUIApplication.ActiveUIDocument

#Preparing input from dynamo to revit
element = UnwrapElement(IN[0])

#Do some action in a Transaction
TransactionManager.Instance.EnsureInTransaction(doc)

TransactionManager.Instance.TransactionTaskDone()

OUT = element

Oh sorry, I didn’t mentioned that I’m using it under Civil 3D, but I realized what you meant. I try to find for a C3D template.
Thanks