CinnamonMetal Posted May 8, 2019 Share Posted May 8, 2019 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" ? Quote Link to comment Share on other sites More sharing options...
probiner Posted July 14, 2019 Share Posted July 14, 2019 (edited) You got this fixed? Adding "python.jediEnabled": false, And removing "python.autoComplete.preloadModules": ["hou"], Seemed to have fixed it for me. Cheers Edited July 14, 2019 by probiner Quote Link to comment Share on other sites More sharing options...
CinnamonMetal Posted July 14, 2019 Author Share Posted July 14, 2019 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 Quote Link to comment Share on other sites More sharing options...
makah21803 Posted January 10, 2020 Share Posted January 10, 2020 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 Quote Link to comment Share on other sites More sharing options...
CinnamonMetal Posted January 12, 2020 Author Share Posted January 12, 2020 @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. Quote Link to comment Share on other sites More sharing options...
makah21803 Posted January 13, 2020 Share Posted January 13, 2020 (edited) 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 January 16, 2020 by makah21803 Quote Link to comment Share on other sites More sharing options...
FJsam Posted September 25, 2020 Share Posted September 25, 2020 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? Quote Link to comment Share on other sites More sharing options...
makah21803 Posted October 6, 2020 Share Posted October 6, 2020 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 Quote Link to comment Share on other sites More sharing options...
Mykolas Posted October 14, 2020 Share Posted October 14, 2020 I found that new pylance python server doesn't recognize hou module. It works fine with old ms-python.python extension though Quote Link to comment Share on other sites More sharing options...
sefisec Posted October 18, 2020 Share Posted October 18, 2020 (edited) "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. Edited October 18, 2020 by sefisec Quote Link to comment Share on other sites More sharing options...
Mykolas Posted November 27, 2020 Share Posted November 27, 2020 On 10/18/2020 at 10:48 AM, sefisec said: "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. Thanks, that helped. Also worth mentioning, that vcode needs to be restarted for changes to work. Quote Link to comment Share on other sites More sharing options...
chumbucket Posted January 25, 2021 Share Posted January 25, 2021 I did what @sefisec said. But it is still not working. Here is my settings.json I'm getting Pylance(reportMissingImports) { "workbench.startupEditor": "newUntitledFile", "[python]": {}, "files.defaultLanguage": "python", "editor.cursorSmoothCaretAnimation": true, "workbench.editorAssociations": [], "python.pythonPath": "C:\\Python27\\python.exe", "python.languageServer": "Pylance", "python.analysis.extraPaths": [ "C:\\Program Files\\Side Effects Software\\Houdini 18.5.531\\houdini\\python2.7libs", ], "terminal.integrated.env.windows": { "PYTHONPATH" : "C:\\Program Files\\Side Effects Software\\Houdini 18.5.531\\houdini\\python2.7libs", "PATH" : "${env:PATH};C:\\Program Files\\Side Effects Software\\Houdini 18.5.531\\bin" }, } Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.