taichi_houdini icon indicating copy to clipboard operation
taichi_houdini copied to clipboard

Error occur when execute function in Houdini python shell

Open QQQQQQinyan opened this issue 2 years ago • 3 comments

It shows errors when I run a function made in Houdini python shell

ti.init() [Taichi] Starting on arch=x64 @ti.kernel ... def foo(): ... print("hello") ... foo()

Errors: Traceback (most recent call last): File "C:\Users\ps\AppData\Roaming\Python\Python37\site-packages\sourceinspect_in it_.py", line 150, in our_findsource return inspect._si_old_findsource(object) File "C:\PROGRA~1\SIDEEF~1\HOUDIN~1.696\python37\lib\inspect.py", line 786, in fin dsource raise OSError('could not get source code') OSError: could not get source code

During handling of the above exception, another exception occurred:

Traceback (most recent call last): File "C:\Users\ps\AppData\Roaming\Python\Python37\site-packages\sourceinspect_in it_.py", line 96, in blender_findsourcetext import bpy ModuleNotFoundError: No module named 'bpy'

During handling of the above exception, another exception occurred:

Traceback (most recent call last): File "C:\Users\ps\AppData\Roaming\Python\Python37\site-packages\sourceinspect_in it_.py", line 153, in our_findsource return blender_findsource(object) File "C:\Users\ps\AppData\Roaming\Python\Python37\site-packages\sourceinspect_in it_.py", line 110, in blender_findsource lines, text_name = blender_findsourcetext(object) File "C:\Users\ps\AppData\Roaming\Python\Python37\site-packages\sourceinspect_in it_.py", line 98, in blender_findsourcetext raise IOError('Not in Blender environment!') OSError: Not in Blender environment!

During handling of the above exception, another exception occurred:

Traceback (most recent call last): File "C:\Users\ps\AppData\Roaming\Python\Python37\site-packages\sourceinspect_in it_.py", line 156, in our_findsource return remote_findsource(object) File "C:\Users\ps\AppData\Roaming\Python\Python37\site-packages\sourceinspect_in it_.py", line 42, in remote_findsource lines = remote_findsourcelines(object) File "C:\Users\ps\AppData\Roaming\Python\Python37\site-packages\sourceinspect_in it_.py", line 28, in remote_findsourcelines raise IOError(f'Cannot find file {file}!' + message) OSError: Cannot find file C:\Users\ps\AppData\Local\Temp\houdini_temp\SI_IPC_10700.p y! To make Taichi functional in IDLE, please append the following line:

import("sourceinspect").remote_hack(globals())

to file "C:\PROGRA~1\SIDEEF~1\HOUDIN~1.696\python37\lib\code.py".

During handling of the above exception, another exception occurred:

Traceback (most recent call last): File "C:\Users\ps\AppData\Roaming\Python\Python37\site-packages\sourceinspect_in it_.py", line 159, in our_findsource return dill_findsource(object) File "C:\Users\ps\AppData\Roaming\Python\Python37\site-packages\sourceinspect_in it_.py", line 145, in dill_findsource return dill.source.findsource(object) File "C:\Users\ps\AppData\Roaming\Python\Python37\site-packages\dill\source.py", l ine 129, in findsource raise IOError(err) OSError: No module named 'readline', please install 'pyreadline'

During handling of the above exception, another exception occurred:

Traceback (most recent call last): File "", line 1, in File "C:\Users\ps\AppData\Roaming\Python\Python37\site-packages\taichi\lang\kernel _impl.py", line 669, in wrapped return primal(*args, **kwargs) File "C:\Users\ps\AppData\Roaming\Python\Python37\site-packages\taichi\lang\shell. py", line 40, in new_call ret = old_call(*args, **kwargs) File "C:\Users\ps\AppData\Roaming\Python\Python37\site-packages\taichi\lang\kernel _impl.py", line 596, in call key = self.ensure_compiled(*args) File "C:\Users\ps\AppData\Roaming\Python\Python37\site-packages\taichi\lang\kernel _impl.py", line 587, in ensure_compiled self.materialize(key=key, args=args, arg_features=arg_features) File "C:\Users\ps\AppData\Roaming\Python\Python37\site-packages\taichi\lang\kernel impl.py", line 395, in materialize src = remove_indent(oinspect.getsource(self.func)) File "C:\Users\ps\AppData\Roaming\Python\Python37\site-packages\sourceinspect_in it.py", line 185, in getsource return inspect.getsource(object) File "C:\PROGRA~1\SIDEEF~1\HOUDIN~1.696\python37\lib\inspect.py", line 973, in get source lines, lnum = getsourcelines(object) File "C:\PROGRA~1\SIDEEF~1\HOUDIN~1.696\python37\lib\inspect.py", line 955, in get sourcelines lines, lnum = findsource(object) File "C:\Users\ps\AppData\Roaming\Python\Python37\site-packages\sourceinspect_in it.py", line 161, in our_findsource raise IOError(f'Could not get source code for object: {repr(object)}') OSError: Could not get source code for object: <function foo at 0x00000000EE4DF288>

QQQQQQinyan avatar Oct 10 '21 03:10 QQQQQQinyan