Importing random module throws error in WIP

python

#1

Hello Everyone,

when trying to import the random module in an empty Python script, autocomplete doesn’t work and I get the following error when running the script:

Message: Methode nicht gefunden: “Void Microsoft.Scripting.Utils.ExceptionUtils.RemoveData(System.Exception, System.Object)”.

Traceback:
_ line 67, in , “C:\Program Files\Rhino WIP\Plug-ins\IronPython\Lib\types.py”_
_ line 6, in , “C:\Program Files\Rhino WIP\Plug-ins\IronPython\Lib\abc.py”_
_ line 11, in , “C:\Program Files\Rhino WIP\Plug-ins\IronPython\Lib_abcoll.py”_
_ line 83, in , “C:\Program Files\Rhino WIP\Plug-ins\IronPython\Lib\UserDict.py”_
_ line 398, in , “C:\Program Files\Rhino WIP\Plug-ins\IronPython\Lib\os.py”_
_ line 9, in , “C:\Program Files\Rhino WIP\Plug-ins\IronPython\Lib\linecache.py”_
_ line 6, in , “C:\Program Files\Rhino WIP\Plug-ins\IronPython\Lib\warnings.py”_
_ line 43, in , “C:\Program Files\Rhino WIP\Plug-ins\IronPython\Lib\random.py”_
_ line 1, in , “C:\Users\WS\AppData\Local\Temp\TempScript.py”_

Am I missing something here?
(maybe @stevebaer ?)

Thanks in advance!


#2

Tried it on a different computer, here everything seems to work as intended.
Probably a problem withe the (Iron)Python installation?


(Nathan 'jesterKing' Letwory) #3
Message: Methode nicht gefunden: "Void Microsoft.Scripting.Utils.ExceptionUtils.RemoveData(System.Exception, System.Object)".

This sounds like different .net versions are installed. Perhaps you could check the differences between your machines regarding those.


#4

Thanks Nathan,
I will check .net versions as soon as I get back to the other machine.


(Steve Baer) #5

This is most likely due to you having installed IronPython. Giulio recently wrote an article about this at


#6

Great @stevebaer ,
thank you for this hint!

I guess this is the issue. I did recently install IronPython via MSI.
Will try to fix that tomorrow.

Thanks a lot! :relaxed:


#7

Have the same problem. But uninstall doesn’t solve the issue.


(Steve Baer) #8

My guess is that the uninstaller didn’t really uninstall everything. You may want to try and use the gacutil tool to see if IronPython is still installed in your system’s global assembly cache

https://msdn.microsoft.com/en-us/library/9x295t9k(v=vs.110).aspx


#9

This becomes more and more complicated…

I don’t know what to do next.

May I ask why Rhino WIP can only use its own IronPython, will this change in the future?


(Steve Baer) #10

Believe me, that is what we were always trying to do and didn’t know this was going to happen for people who installed this version of IronPython separate from Rhino. Currently I’m just trying to get your computer back in a state where Rhino’s python interpreter actually runs.

Did you see IronPython in that output?


#11

No… I didn’t.
But maybe I missed.

I’m not very familiar with that command line tools. Is there something like
"grep" in linux that can grep “ironpython” from the output?


(Steve Baer) #12

you could try

gacutil IronPython

#13

Short feedback from my side:
For me, uninstalling IronPython did solve the problem. Rhino Python now works well again.
Thanks for your help!


#14

OK.
I found one IronPython 2.7.0 assembly that failed to install.
And uninstalled it.
But the problem still exist.

And the one I uninstalled happen to be Rhino 5’s. So I also have to
reinstall Rhino 5…And this doesn’t help… Now I cannot use python even in Rhino 5…


#15

OK, lastest update:

With trying for hours for making at least one python inside rhino work, I finally found the solution.
I need to delete the folder “IronPython (814d908a-e25c-493d-97e9-ee3861957f49)” in my user folder under c:/User/xxx/app data and reinstall Rhino.

And now both Rhino 5 and Rhino 6 start to work.
I think that folder contains some info that will not update when install/uninstall IronPython or Rhino and causes these error.


Cannot load "os" module in python in Rhino WIP