ImportError: Cannot import name zip_longest

Hi network,

I am trying to run EPlus using EPPY library for python.

When I try to execute the code shown in image, I am getting an Import Error as follow,
*Warning: IronPythonEvaluator.EvaluateIronPythonScript operation failed. *
Traceback (most recent call last):

  • File “”, line 8, in *
  • File “C:\Users\User\AppData\Local\Programs\Python\Python310\Lib\site-packages\eppy\”, line 25, in *
  • File “C:\Users\User\AppData\Local\Programs\Python\Python310\Lib\site-packages\eppy\”, line 16, in *
    ImportError: Cannot import name zip_longest


Can anyone help with this?

Could you try importing all vs just IDF?

from eppy.modeleditor import *

1 Like

Hi @SeanP ,
Well I tried to import all, except selected function.

Yest the issue remains same.

Hello @utech.udara
The EPPY package is not compatible with IronPython.
To install python packages with CPython3 engine, see these links


Thank you for your response. I tried the same method as shown in the link. Yet for package eppy I am getting following error message once try to install through cmd.

after testing, I confirm the bug, I don’t think there is an easy solution to this problem.
My first idea would be to install Python on your machine exactly the same version of CPython Engine as dynamo, then install eppy from this installation and add the sys.path in your script

1 Like

Thank you very much for the reply.
I found a solution using following workflow.

  1. First I installed same version of python in my computer and installed eppy for default folder.
  2. Then I copied site packages and replaced in the python folder of Dynamo.
  3. But eppy runs only in Dynamo sandbox environment not thorugh Dynamo for Revit.

Check if it’s the same version of Python in Revit

Yes I am using the same version of Python as in the system. Yet the error message is as follows,

Warning: PermissionError : [Errno 13] Permission denied: ‘in.idf’ [’ File “”, line 15, in \n’, ’ File “C:\Users\User\AppData\Local\python-3.8.3-embed-amd64\lib\site-packages\eppy\”, line 1042, in run\n self.saveas(“in.idf”)\n’, ’ File “C:\Users\User\AppData\Local\python-3.8.3-embed-amd64\lib\site-packages\eppy\”, line 1008, in saveas\n, lineendings, encoding)\n’, ’ File “C:\Users\User\AppData\Local\python-3.8.3-embed-amd64\lib\site-packages\eppy\”, line 977, in save\n with open(filename, “wb”) as idf_out:\n’]

strange :face_with_raised_eyebrow: , I have no ideas

1 Like