Autocompletion Pycharm Houdini
10693 10 3- Matthew05
- Member
- 94 posts
- Joined: April 2011
- Offline
Hi,
After a reinstall of Windows, I need to setup Pycharm with Houdini again. So I managed to get the hou module loaded inside of Pycharm, but I don't have any autocompletion working. Here is what I have. If I use the Python Console inside of Pycharm, I don't have any issue.
Any idea of where it can comes from?
I'm using Win10, Pycharm Community 2020.1
After a reinstall of Windows, I need to setup Pycharm with Houdini again. So I managed to get the hou module loaded inside of Pycharm, but I don't have any autocompletion working. Here is what I have. If I use the Python Console inside of Pycharm, I don't have any issue.
Any idea of where it can comes from?
I'm using Win10, Pycharm Community 2020.1
- doctorbob
- Member
- 30 posts
- Joined:
- Offline
Hi Ioness,
if i'm understanding your setup correctly, you either need to
1) use hython as your python interpreter (https://www.jetbrains.com/help/pycharm/configuring-python-interpreter.html#) - point it to /your/houdini/installation/hython
this will give you autocomplete, but will pull a license (this may or may not bother you)
OR
2) use a hou stub file like the attached. make sure it's somewhere on your PYTHONPATH so pycharm an find it, and you'll get (basic) autocomplete for hou. this will run in a non-houdini python interpreter, won't pull a license and is more friendly if you're making cross-application code
cheers,
chrisg
if i'm understanding your setup correctly, you either need to
1) use hython as your python interpreter (https://www.jetbrains.com/help/pycharm/configuring-python-interpreter.html#) - point it to /your/houdini/installation/hython
this will give you autocomplete, but will pull a license (this may or may not bother you)
OR
2) use a hou stub file like the attached. make sure it's somewhere on your PYTHONPATH so pycharm an find it, and you'll get (basic) autocomplete for hou. this will run in a non-houdini python interpreter, won't pull a license and is more friendly if you're making cross-application code
cheers,
chrisg
Edited by doctorbob - June 21, 2020 20:40:51
- Matthew05
- Member
- 94 posts
- Joined: April 2011
- Offline
Hi Doctorbob,
So I tried to do as you told me, to use hython as my python interpreter but I am still having the same issue. I will have to test it on Linux to see if it's doing the same thing. On the meantime, I will use VSCode, which is giving me a full working autocompletion.
I also tried using both houdini version with python 2.7 and python 3.7, both giving me the same result
So I tried to do as you told me, to use hython as my python interpreter but I am still having the same issue. I will have to test it on Linux to see if it's doing the same thing. On the meantime, I will use VSCode, which is giving me a full working autocompletion.
I also tried using both houdini version with python 2.7 and python 3.7, both giving me the same result
Edited by Matthew05 - June 22, 2020 08:55:00
- Matthew05
- Member
- 94 posts
- Joined: April 2011
- Offline
Hey everyone,
So I manage to find a solution. The way to get it working was to simply import the module like that inside of Pycharm:
I now have full autocompletion working correctly. Due to my knowledge of python, I am not sure of why I need to do it that way instead of just doing This same import is working perfectly with Visual Studio Community, so I guess this might be coming from PyCharm
So if anybody as an idea of why Pycharm is behaving this way, I will be glad too here it
So I manage to find a solution. The way to get it working was to simply import the module like that inside of Pycharm:
import hou as hou
import hou
So if anybody as an idea of why Pycharm is behaving this way, I will be glad too here it
Edited by Matthew05 - July 1, 2020 15:02:02
- neonjunkyards
- Member
- 20 posts
- Joined: Sept. 2013
- Offline
does anyone have any updates on this? Autocomplete was working fine in pycharm a few weeks ago but after upgrading Houdini daily builds, updating pycharm, now hou autocomplete is completely broken.
Tried hython interpreter, houdini python2.7, system python2.7, added $HFS/houdini/python2.7libs to extra paths in pycharm, added $HFS/bin to $PATH in system environment variables, rolled back houdini installs, rolled back pycharm installs, on 2 different machines. Nothing works
The stubs file works ok for first level autocomplete (hou.) but stops working on any level deeper. VSCode works perfectly with exactly the same configuration as pycharm, but VScode PySide2 autocomplete isn't great…
This makes me think this is a pycharm problem not a Houdini problem, but has anyone solved this?
Tried hython interpreter, houdini python2.7, system python2.7, added $HFS/houdini/python2.7libs to extra paths in pycharm, added $HFS/bin to $PATH in system environment variables, rolled back houdini installs, rolled back pycharm installs, on 2 different machines. Nothing works
The stubs file works ok for first level autocomplete (hou.) but stops working on any level deeper. VSCode works perfectly with exactly the same configuration as pycharm, but VScode PySide2 autocomplete isn't great…
This makes me think this is a pycharm problem not a Houdini problem, but has anyone solved this?
- elovikov
- Member
- 130 posts
- Joined: June 2019
- Offline
Hi!
There's a limit in pycharm on a file length for indexing. By default it's 2.56 and recently hou.py just exceeds that limit
So to fix that go to Help -> Edit Custom Properties (it asks to create one if it doesn't exist, just hit Create)
Then put this line to idea.properties:
3000 is just an example you can make it higher to prevent problems in future
Then go to File -> Invalidates Cache / Restart. That should fix the issue with indexing (so path to hou.py has to be configured correctly and you need only $HFS/houdini/python2.7libs btw)
There's a limit in pycharm on a file length for indexing. By default it's 2.56 and recently hou.py just exceeds that limit
So to fix that go to Help -> Edit Custom Properties (it asks to create one if it doesn't exist, just hit Create)
Then put this line to idea.properties:
idea.max.intellisense.filesize=3000
3000 is just an example you can make it higher to prevent problems in future
Then go to File -> Invalidates Cache / Restart. That should fix the issue with indexing (so path to hou.py has to be configured correctly and you need only $HFS/houdini/python2.7libs btw)
- neonjunkyards
- Member
- 20 posts
- Joined: Sept. 2013
- Offline
- Shadowjonny
- Member
- 97 posts
- Joined: May 2015
- Offline
I keep getting any error when I try to add hython.exe in my Pycharm Python Interpreter i get this error :
Nvm got it working now
Error: Standard Python ‘venv’ module not foundAnyone know why? I cant get Pycharm to work with houdini using 18.5.351, python 2.7.17, Pycharm 2020.2.3
Nvm got it working now
Edited by Shadowjonny - Nov. 13, 2020 00:23:35
- wyhinton1
- Member
- 80 posts
- Joined: Feb. 2020
- Offline
- wyhinton1
- Member
- 80 posts
- Joined: Feb. 2020
- Offline
I just ended up copying the entire python3.7libs folder from "C:\Program Files\Side Effects Software\Houdini 19.0.622\houdini\python3.7libs" into my VSCode project and it worked.
wyhinton1
Tried adding hython.exe and hython3.7.exe as interpreters in VSCode and I get "An invalid Python interpreter is selected, please try changing it to enable features such as IntelliSense, linting and debugging."
- supersaqib
- Member
- 8 posts
- Joined: Dec. 2011
- Offline
elovikov
Hi!
There's a limit in pycharm on a file length for indexing. By default it's 2.56 and recently hou.py just exceeds that limit
So to fix that go to Help -> Edit Custom Properties (it asks to create one if it doesn't exist, just hit Create)Image Not Found
Then put this line to idea.properties:idea.max.intellisense.filesize=3000Image Not Found
3000 is just an example you can make it higher to prevent problems in future
Then go to File -> Invalidates Cache / Restart. That should fix the issue with indexing (so path to hou.py has to be configured correctly and you need only $HFS/houdini/python2.7libs btw)
This is the one that worked for me in combination with setting Hython to the interpreter. Not sure why it says Hython 3.11 when i only have Python 3.9 and chose Hython39.exe but i digress. Got it working with the python3.9libs too. Also looks like 3000 was not enough so i put it to 30000 cos i'm chaotic in nature.
Edited by supersaqib - March 28, 2023 17:14:16
Saqib
Just take it one OP at a time and you will find inner peace.
Just take it one OP at a time and you will find inner peace.
-
- Quick Links