Jump to content
CinnamonMetal

Loading Houdini Python modules into Code Issues

Recommended Posts

I'm hoping someone has successfully gotten the Houdini python modules to load into Visual Studio Code intellisense as I'm having problems; specifically with the settings.json setting, "python.autoComplete.preloadModules": "hou" ?

Share this post


Link to post
Share on other sites

You got this fixed?

Adding

"python.jediEnabled": false,

And removing 
 

"python.autoComplete.preloadModules": ["hou"],

Seemed to have fixed it for me.

w3ypb7N.png

Cheers

Edited by probiner

Share this post


Link to post
Share on other sites

I know about disabling Jedi and allow the Python Language server to take over which fixes the issues that were with Jedi. although, now I'm just having problems getting the environment variable setup specifically within code, hopefully soon :mellow:

Share this post


Link to post
Share on other sites

Hi,

Im new to python, Im trying to use vscode as external editor but it really sucks at being intuitive for a beginner...

Im trying to add the hou.module so I can see the functions but Im getting this error:

The setting 'python.autoComplete.preloadModules' is deprecated, please consider using the new Language Server ('python.jediEnabled = false').

my settings.json looks like this:

{
    "python.pythonPath""C:\\PROGRA~1\\SIDEEF~1\\HOUDIN~1.287\\python27\\python.exe",
    "python.linting.pylintEnabled"false,
    "python.linting.enabled"true,
    "python.linting.flake8Enabled"true,
    "[python]":{},
    "python.jediEnabled"false,
    "python.autoComplete.extraPaths": [ "C:\Program Files\Side Effects Software\Houdini 18.0.287\houdini\python2.7libs\hou.pyc" ],
    "python.autoComplete.preloadModules": ["hou"]
}

Also wheeve I edit a .py Code tells me: Linter flake8 is not installed. And when I click Install is says: There is no Pip installer available in the selected environment. 

Im using:
Windows 10
Houdini 18
VS Code v 1.41.1
Python v 2.7.15 64-bit

 

 

Share this post


Link to post
Share on other sites

@makah21803 You have single `\` make sure they are double `\\`. You don't need; "python.autoComplete.preloadModules":["hou"] that is only for Jedi as you see is disabled, just remove that line, completely.

Share this post


Link to post
Share on other sites

Thanks, I overlooked that.

...it doesn't give me the error now, but it still doesn't recognise the hou.module classes :/ 
(Ive tried without the [ ] brackets too)

Im using:
Windows 10
Houdini 18
VS Code v 1.41.1
Python v 2.7.15 64-bit

Edited by makah21803

Share this post


Link to post
Share on other sites
On 1/14/2020 at 12:29 AM, makah21803 said:

Thanks, I overlooked that.

...it doesn't give me the error now, but it still doesn't recognise the hou.module classes :/ 
(Ive tried without the [ ] brackets too)

Im using:
Windows 10
Houdini 18
VS Code v 1.41.1
Python v 2.7.15 64-bit

Any news?

Share this post


Link to post
Share on other sites
On 25/09/2020 at 3:38 PM, FJsam said:

Any news?

No, I didnt manage to import hou classes to VS Code. I gave up and was doing it just directly in houdini

Share this post


Link to post
Share on other sites

I found that new pylance python server doesn't recognize hou module. It works fine with old ms-python.python extension though

Share this post


Link to post
Share on other sites
"python.analysis.extraPaths": [
    "C:\\Program Files\\Side Effects Software\\Houdini 18.0.597\\houdini\\python2.7libs",
],

"terminal.integrated.env.windows": { 
    "PYTHONPATH" : "C:\\Program Files\\Side Effects Software\\Houdini 18.0.597\\houdini\\python2.7libs",
    "PATH" : "${env:PATH};C:\\Program Files\\Side Effects Software\\Houdini 18.0.597\\bin"
},

"python.languageServer": "Pylance",

That's what you need to have in settings.json.

VS Code will only show autocompletion if Project Folder is opened and File is saved in that folder (at least it's that way for me).

If I need to write a bit of a Python for current project, I don't open editor from Windows menu of Houdini, I just open houdini_temp directory as project folder in VS Code, and edit code directly in __python_source_editor.py.

And if you want to edit code from Python Wrangle node, then just after file opened in VS Code, save it with the same name, so Pylance could pick up it (and Project Folder should be already open).

That's what worked for me in my case.

 

5f8bf3326349e_Screenshot-2020-10-1818_47_44.png.a24140446090f3a0d6ecb84afe3ab5b4.png

 

 

Edited by sefisec

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×