CPython and PyRevit

Hello All,

first of all, this question might be repetitive. if so, please point me to the right solution.

Here is my question: I need to use CPython to have access to libraries such as numpy and pandas. At the same time, I want to take advantage of Pyrevit’s capabilities such as forms etc. As far as I understood, I can’t have both of these on a single script file. If I got this correctly, is there any way to do this?

Thanks in advance

Hi @Ped_ra ,
unfortunately this is not possible at the moment, the pyrevit lib is still not completely compatible with CPython, so you can’t access things like logging and forms.

A really bad workaround to do GUIs for now is to write the old WinForms Form classes, or use the tkinter python library.

I will try to get CPython working in my spare time, watch for updates on this github issue.

Hi @sanzoghenzo,

Thanks for your input. I’m looking forward to your updates.
You’re right, there are some limitations to doing so thanks to the existing situation. However, I recently noticed that we can take advantage of Python subprocess to make this work. I’ll share a practical example on my GitHub very soon, but the links below can provide enough details on implementing this. I tried this solution and confirm that it’s functional.
Link 1: pyRevit - Dynamo Incompatibility: Two versions of Same DLL · Issue #1731 · eirannejad/pyRevit · GitHub
Link 2: subprocess — Subprocess management — Python 3.11.4 documentation

I hope this solution helps others too.

2 Likes