Integrating pycharm and Houdini

   4184   6   3
User Avatar
Member
49 posts
Joined: Feb. 2016
Offline
I was trying to run Houdini Python interpreter in Pycharm(2019) but I got this error:
Traceback (most recent call last):
  File "F:/dev/dwfx-rig-houdini/python/fxr/build/test.py", line 1, in <module>
    import hou
  File "C:\Program Files\Side Effects Software\Houdini 17.0.352\houdini\python2.7libs\hou.py", line 19, in <module>
    import _hou
ImportError: DLL load failed: The specified module could not be found.
I was I went through a couple forum post with similar issue but couldn't find the fix yet.
Here are the steps I went through:
1. Settings -> project interpreter -> Base interpreter as C:\Program Files\Side Effects Software\Houdini 17.0.352\python27
2. After the project interpreter is setup, add the path C:\Program Files\Side Effects Software\Houdini 17.0.352\houdini\python2.7libs to the interpreter Path

Thanks,
Ben
User Avatar
Member
40 posts
Joined: Aug. 2019
Offline
Hey, did you manage to find the fix?
User Avatar
Member
49 posts
Joined: Feb. 2016
Offline
No, haven't find a solution yet
User Avatar
Member
27 posts
Joined: Feb. 2017
Offline
You can use hython.exe from $HFS/bin instead of python.exe
English is not my native language, sorry in advance for any misunderstanding
User Avatar
Member
40 posts
Joined: Aug. 2019
Offline
For me, to use hou module outside of Houdini, it was enough to add $HFS/bin to PATH and add $HFS/houdini/python2.7libs to PYTHONPATH.
This will work on win and linux. And this will not work on macOS due to different rpath logic, you will have to use hython or manually adding a needed path to the list of RPATH's in Houdini's libraries
Edited by hshakula - March 20, 2020 04:22:11
User Avatar
Member
146 posts
Joined: June 2016
Offline
Thanks for the answers, i ve read through many forum and posts but couldnt able to import hou into pycharm .

anvdev
You can use hython.exe from $HFS/bin instead of python.exe

When i try this, i cant able to select the hython.exe, it error `invalid interpreter name`
Edited by Mohanpugaz - May 24, 2023 04:40:18
Mohan Pugaz
movfx
https://www.instagram.com/movfx/ [www.instagram.com]
https://www.youtube.com/channel/@_movfx
User Avatar
Member
16 posts
Joined: Oct. 2017
Offline
Hello, if you are interested I've written a little python stubs generator for Houdini available here :

https://github.com/romainaugier/HoudiniPythonStubsGenerator [github.com]

You can use hython to generate the stubs and then simply add the path to the stubs file in your editor configuration.

Cheers,
  • Quick Links