Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Bug]: Dynamo cannot execute python node if pyRevit is installed #2400

Open
5 tasks done
GiuseppeDotto opened this issue Sep 11, 2024 · 17 comments
Open
5 tasks done

[Bug]: Dynamo cannot execute python node if pyRevit is installed #2400

GiuseppeDotto opened this issue Sep 11, 2024 · 17 comments
Labels
Bug Bug that stops user from using the tool or a major portion of pyRevit functionality [class] Heisenbug Bug that is very hard to find [class]

Comments

@GiuseppeDotto
Copy link

✈ Pre-Flight checks

  • I don't have SentinelOne antivirus installed (see above for the solution)
  • I have searched in the issues (open and closed) but couldn't find a similar issue
  • I have searched in the pyRevit Forum for similar issues
  • I already followed the installation troubleshooting guide thoroughly
  • I am using the latest pyRevit Version

🐞 Describe the bug

All the computer of the office where I work have issue with executing python dynamo nodes since pyRevit is installed on their computer.

error messages

These are the errors that popup from their Dynamo:
image
(this pops up as soon as the python node is called)

image
(this pops up is the user does some operation, for example, change the engine to IronPython2 and then revert to CPython)

further info

  • The issue only occurs if the engine used by Dynamo is CPython. With IronPython 2 everything works just fine.
  • the script inside of the screenshotted python node is OUT=IN

researches

I read a similar issue unfortunately closed without answers: Errors in Dynamo Python Script.

⌨ Error/Debug Message

attempt to read or write protected memory.

♻️ To Reproduce

just open Dynamo and create python node

⏲️ Expected behavior

CPython in Dynamo should work properly

🖥️ Hardware and Software Setup (please complete the following information)

Windows 11

$pyrevit env

==> Registered Clones (full git repos)
==> Registered Clones (deployed from archive/image)
pyOMA | Deploy: "core" | Branch: "master" | Version: "4.8.16" | Path: "C:\Users\gdotto\AppData\Roaming\pyOMA"
==> Attachments
pyOMA | Product: "24.2" | Engine: DEFAULT (2711) | Path: "C:\Users\gdotto\AppData\Roaming\pyOMA"
pyOMA | Product: "23.1.3" | Engine: DEFAULT (2711) | Path: "C:\Users\gdotto\AppData\Roaming\pyOMA"
pyOMA | Product: "Autodesk Revit 2021" | Engine: DEFAULT (2711) | Path: "C:\Users\gdotto\AppData\Roaming\pyOMA"
==> Installed Extensions
DDeT | Type: Unknown | Repo: "" | Installed: "\\office-server\DDeT.extension"
pyOMA | Type: Unknown | Repo: "" | Installed: "\\office-server\pyOMA.extension"
pyRevitCore | Type: UIExtension | Repo: "" | Installed: "\\office-server\pyRevitCore.extension"
pyRevitTools | Type: UIExtension | Repo: "" | Installed: "\\office-server\pyRevitTools.extension"
==> Default Extension Search Path
C:\Users\gdotto\AppData\Roaming\pyRevit\Extensions
==> Extension Search Paths
C:\Users\gdotto\OneDrive - Office for Metropolitan Architecture\Documents\GitHub\myPrivate
\\office-server
==> Extension Sources - Default
https://github.com/pyrevitlabs/pyRevit/raw/master/extensions/extensions.json
==> Extension Sources - Additional
==> Installed Revits
24.2 | Version: 24.2.0.63 | Build: 20231029_1515(x64) | Language: 1033 | Path: "C:\Program Files\Autodesk\Revit 2024\"
23.1.3 | Version: 23.1.30.97 | Build: 20230828_1515(x64) | Language: 1033 | Path: "C:\Program Files\Autodesk\Revit 2023\"
Autodesk Revit 2021 | Version: 21.1.21.45 | Build: 20201116_1100(x64) | Language: 1033 | Path: "C:\Program Files\Autodesk\Revit 2021\"
==> Running Revit Instances
PID: 3860 | 24.2 | Version: 24.2.0.63 | Build: 20231029_1515(x64) | Language: 0 | Path: "C:\Program Files\Autodesk\Revit 2024"
==> User Environment
Microsoft Windows 10 [Version 10.0.22631]
Executing User: OMA\gdotto
Active User:
Admin Access: No
%APPDATA%: "C:\Users\gdotto\AppData\Roaming"
Latest Installed .Net Framework: 4.8
No .Net Target Packs are installed.
No .Ne-Core Target Packs are installed.
pyRevit CLI v4.8.16.24121+2117.23a0b8cbc4babdeb29a0611e159d017bbe9cbad5

Additional context

No response

@GiuseppeDotto GiuseppeDotto added the Bug Bug that stops user from using the tool or a major portion of pyRevit functionality [class] label Sep 11, 2024
@jmcouffin
Copy link
Contributor

Version of revit used? Version of Dynamo?

Just saying here, The issue can be on both sides Dynamo or pyRevit
DynamoTeam is actually a team, so maybe asking on their forum or GH might make more sense.

@jmcouffin
Copy link
Contributor

I personaly never had this type of issue

@GiuseppeDotto
Copy link
Author

Revit: 2024.2.0
Dynamo: v.2.19.3

We already opened a ticket with Autodesk that didn't get solved. Particularly hard case because I can't replicate it anywhere else except for the office computers.

I will definitely open again a blog post on Dynamo forum, here is the previous one.
In the meantime, any hint from your side is very welcome.

@jmcouffin
Copy link
Contributor

Just tried it on my machine, not reproductible. Revit 2024, latest everything.

ipy2-cpy3.mp4

wild guess, any other python installed on computers.
dynamo has its own python engines, pyrevit too.
Maybe you have vanilla python installs for other purposes and they do not behave nicely?

@GiuseppeDotto
Copy link
Author

Thanks a lot for the reply.
on my computer there is a vanilla python installed, however I would exclude this is the cause because other users without python installed have the same issue. Additionally, this issue started upon pyRevit installation.

As you saw, the post on the dynamo forum is quite old. I will take care to run another test uninstalling pyRevit and I will let you know if the issue really depends on pyRevit installation.

@thomvill
Copy link

I'm having the same issue. CPython nodes work when deactivating pyRevit, but not when pyRevit is active.

@jmcouffin
Copy link
Contributor

on my computer there is a vanilla python installed, however I would exclude this is the cause because other users without python installed have the same issue. Additionally, this issue started upon pyRevit installation.

maybe they have rhino GH + rhino inside revit?

@GiuseppeDotto
Copy link
Author

I confirm the behavior, python on Dynamo works if pyRevit is not installed.
The computers with the issue don't have rhino inside revit.

@jmcouffin
Copy link
Contributor

I confirm the behavior, python on Dynamo works if pyRevit is not installed. The computers with the issue don't have rhino inside revit.

Can you precisely provide the steps you performed? @GiuseppeDotto

I need to be able to reproduce.

@GiuseppeDotto
Copy link
Author

correct, sorry @jmcouffin for lacking information. The test was performed in 2 different scenario:

scenario 1

  1. starting from a computer without pyRevit installed
  2. Dynamo check => python works ✅
  3. install pyRevit using CLI
  4. Dynamo check => python doesn't work ❌

scenario 2

  1. starting from a computer with pyRevit already installed
  2. Dynamo check => python doesn't work ❌
  3. uninstall pyRevit and delete all the clones
  4. Dynamo check => python works ✅
  5. install pyRevit using CLI
  6. Dynamo check => python doesn't work ❌

how do we install pyRevit

the way we deploy pyRevit to all the office computer is simple as:

  1. install the latest pyRevit CLI with Admin rights
  2. run a BAT script to clone pyRevit core, attach to all the Revit versions and add our custom paths. See below for reference

pyrevit clone ourCloneName core --dest=%appdata%\ourCloneName
pyrevit attach ourCloneName 2711 --installed
pyrevit extensions paths add "\our\path\to\the\folder\with\extensions"

@thomvill
Copy link

I'll add that in my case it's enough to disable the pyRevit addin-file and restart Revit for the CPython nodes to start working, and vice versa. No need to uninstall/reinstall for new behavior to appear.

@jmcouffin
Copy link
Contributor

and Revit 2024 Dynamo 2.19.3 right?
other versions too?

@GiuseppeDotto
Copy link
Author

Yes, is still Revit 2024.2 and Dynamo 2.18.3.
I just tried with Revit 2023.1 and Dynamo 2.16.2 and the issue is still occurring.
The doesn't take place with Revit 2021, where the python engine was still IronPython.

@Oliver2201
Copy link

Oliver2201 commented Sep 25, 2024

Has anyone found a workaround this? im having same problems but doesn't matter if i use Cpython or IronPython. And everything work as soon as i turn of pyrevit for the current revit version and restart revit with it turned of.

At first I thought it was do to a windows update my company rolled out as everything stopped working last week around that time. Might still be a combination? Could there have been something in the windows update that is giving me problems with python in dynamo and pyrevit?

@jmcouffin
Copy link
Contributor

Has anyone found a workaround this? im having same problems but doesn't matter if i use Cpython or IronPython. And everything work as soon as i turn of pyrevit for the current revit version and restart revit with it turned of.

At first I thought it was do to a windows update my company rolled out as everything stopped working last week around that time. Might still be a combination? Could there have been something in the windows update that is giving me problems with python in dynamo and pyrevit?

I do think this is a different matter.

The thing is, I cannot reproduce on my computer. I did play with dynamo up and down in revit 2024 with the latest WIP installers and no issu switching from cpython to ironpython back and forth.

@jmcouffin jmcouffin added the Heisenbug Bug that is very hard to find [class] label Sep 25, 2024
@GiuseppeDotto
Copy link
Author

I actually had the same thought than @Oliver2201 , just our updates happened 1 year ago, and since then I tried to replicate the issue, without success, on many other computers out of my organization.
@jmcouffin , if you know about any possible method to display a more informative error message, I am very happy to test it out.

@jmcouffin
Copy link
Contributor

Apart from the revit journal and dynamo logs, no idea.
Maybe asking to the dynamo team? The error happens in dynamo after all

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug Bug that stops user from using the tool or a major portion of pyRevit functionality [class] Heisenbug Bug that is very hard to find [class]
Projects
None yet
Development

No branches or pull requests

4 participants