Python Shell - 'No module named pyevent'

Python Shell - 'No module named pyevent'

rjohnstonBK2JP
Contributor Contributor
1,997 Views
5 Replies
Message 1 of 6

Python Shell - 'No module named pyevent'

rjohnstonBK2JP
Contributor
Contributor

I'm working on running some code inside of the python shell but I keep getting this error message and can't seem to solve it. Whenever I run the code I have (and I'm new at this so explain it to me like I'm 5), I get the error message, "Exception : IronPython.Runtime.Exceptions.ImportException: No module named pyevent". The whole error message is below.

 

From my google searching I found that I'm supposed to install padas inside of my python enviornment but I have no idea how to do this (like I said, I'm new and learning). Here's the link to the website where I found that.

 

Thank you for your help!

 

rjohnstonBK2JP_0-1647613160724.png

 

Accepted solutions (1)
1,998 Views
5 Replies
Replies (5)
Message 2 of 6

sergey.brezgin
Explorer
Explorer

@rjohnstonBK2JP  I'm having the same issue. "ImportException: No module named pyevent".
I opened _init_.py file for Forms with VS and found there on the line 43 import pyevent, but I don't understand where it should import it from.. did you find any solution?

sergeybrezgin_0-1648584471913.pngsergeybrezgin_1-1648584543120.png

 

0 Likes
Message 3 of 6

rjohnstonBK2JP
Contributor
Contributor
I unfortunately have not found a solution yet. This had to get put on the sidelines for now until I have more time to figure it out myself. I found a partial solution on the GitHub for pyRevit in the issues tab. See link below. I'm going to post another issue in there to see if the developer will respond.

https://github.com/eirannejad/pyRevit/issues/1291
0 Likes
Message 4 of 6

sergey.brezgin
Explorer
Explorer
Accepted solution

Good news - I solved it!
You need to add the path to "site-packages" in the RevitPythonShell.xml file.

If it still doesn't work then you will need to point PYTHONPATH environment variable to the same "site-packages" folder , but I think the first step solves it.

 

sergeybrezgin_0-1648995869701.png

 

Message 5 of 6

rjohnstonBK2JP
Contributor
Contributor

@sergey.brezgin that worked! All I had to do was

  1.  Find the file called 'RevitPythonShell' inside of this folder: C:\Users\name\AppData\Roaming\RevitPythonShell\2021 and open with notepad.
  2. insert that line of code: <SearchPath name="C:\Users\name\AppData\Roaming\pyRevit-Master\site-packages" />
  3. Save and close

Thank you so much for the help @sergey.brezgin 

0 Likes
Message 6 of 6

RIPENG
Enthusiast
Enthusiast

I experienced similar pyrevit forms trouble related to add-in environment under-configuration.


Configuration:

Revit - 2021.1.3,

RevitPythonShell - 2021.0.0.0 on IronPython 3.4.0,

pyRevit - v4.8.16 on IronPython 3.4.0.


To resolve environment under-configuration I added a pyrevit 'site-packages' search path to RevitPythonShell. Please see the graphic below for details.

 

RevitPythonShell_Environment_pyRevit_Search Paths.JPG

 

Also, for those new to pyRevit & RevitPythonShell (like me) please note that it seems like both add-ins require the same IronPython environment. Otherwise, pyRevit imports into the RevitPythonShell environment will generate IronPython environment related warnings.

 

I took a cursory look at add-in documentation but nothing jumped out at me in terms of explicit statements regarding IronPython versions for respective add-ins. I arrived at the configuration listed above through intuition and guess & check.

 

-Jake

0 Likes