captainhammy / Houdini-Toolbox

Houdini things!
http://www.houdinitoolbox.com
MIT License
188 stars 41 forks source link

Errors on first install - Windows #14

Closed MostHated closed 4 years ago

MostHated commented 4 years ago

Hey there, I went to try this out but was greeted by this over and over when starting Houdini:


Error running event handler:
Traceback (most recent call last):
  File "E:/GitHub/Houdini-Toolbox/houdini/scripts/OnInstall.py", line 8, in <module>
    from ht.events import NodeEvents, run_event
ImportError: No module named ht.events

Error running event handler:
Traceback (most recent call last):
  File "E:/GitHub/Houdini-Toolbox/houdini/scripts/OnInstall.py", line 8, in <module>
    from ht.events import NodeEvents, run_event
ImportError: No module named ht.events

Error running event handler:
Traceback (most recent call last):
  File "E:/GitHub/Houdini-Toolbox/houdini/scripts/OnInstall.py", line 8, in <module>
    from ht.events import NodeEvents, run_event
ImportError: No module named ht.events

I also received this as well:

Traceback (most recent call last):
  File "Mouse Event Handler", line 1, in <module>
  File "C:/PROGRA~1/SideFX/HOUDIN~1.348/houdini/python2.7libs\nodegraph.py", line 25, in <module>
    import nodegraphhooks as hooks
  File "E:/GitHub/Houdini-Toolbox/houdini/python2.7libs\nodegraphhooks.py", line 8, in <module>
    from ht.ui import paste
ImportError: No module named ht.ui

Thanks, -MH

captainhammy commented 4 years ago

Greetings. Do you happen to have more information on your setup? It looks like you have set HOUDINI_PATH (since it's finding all the scripts and stuff) but not the PYTHONPATH. Are you using houdini.env? Manually configuring things in a different way?

I am experiencing no issues with the example Windows install directions and a houdini.env file:

HOUDINI_PATH = "D:\Houdini-Toolbox\houdini;&" PYTHONPATH = "D:\Houdini-Toolbox\python"

MostHated commented 4 years ago

Hello, yes I did have that set, perhaps I did it incorrectly? I swore I saw somewhere that I was supposed to do the PYTHONPATH the way I am doing it below, but now I am not sure, lol.

Here is what I attempted to use:

TABTOO="E:\_houdini\_addons\Tabttoo_Release_v0.18"
CACHEIT="E:\_houdini\_addons\CacheIt"
HTOOLBOX="E:\GitHub\Houdini-Toolbox\houdini"
MARKINGMENU="E:\GitHub\houdini_markingmenu"
ADDONS="E:\_houdini\_addons"

HTOOLBOXPY="E:\GitHub\Houdini-Toolbox\python"

RMANTREE="C:\Program Files\Pixar\RenderManProServer-23.0"
RFHTREE="C:\Program Files\Pixar\RenderManForHoudini-23.0"
RMAN_PROCEDURALPATH=$RFHTREE\18.0\openvdb;&

HOUDINI_PATH=$RFHTREE\18.0;$TABTOO;$CACHEIT;$HTOOLBOX;$MARKINGMENU;$ADDONS;&
PYTHONPATH=$PYTHONPATH;HTOOLBOXPY;
PATH=$RMANTREE\bin;&
captainhammy commented 4 years ago

It looks like you are just missing the $ in front of the variable name when setting your PYTHONPATH

MostHated commented 4 years ago

You will have to forgive me, I had removed it from the config completely and just added it back in now to demonstrate how I had it set up prior. I believe I had the $ in the proper place before, but I just gave it a go now again using the above config (with $ fixed), but still received an error. I made sure to do a fresh pull in case there were updates since I last tried.

This is what I currently received:

Error in initialization event handling:
"No module named pwd"

Details:
"Traceback (most recent call last):
  File \"Initialization Event Handler\", line 1, in <module>
  File \"C:/PROGRA~1/SideFX/HOUDIN~1.356/houdini/python2.7libs\\nodegraph.py\", line 25, in <module>
    import nodegraphhooks as hooks
  File \"E:/GitHub/Houdini-Toolbox/houdini/python2.7libs\\nodegraphhooks.py\", line 8, in <module>
    from ht.ui import paste
  File \"E:\\GitHub\\Houdini-Toolbox\\python\\ht\\ui\\paste\\__init__.py\", line 9, in <module>
    from ht.ui.paste.sources import HomeToolDirSource, SourceManager
  File \"E:\\GitHub\\Houdini-Toolbox\\python\\ht\\ui\\paste\\sources.py\", line 13, in <module>
    from pwd import getpwuid
ImportError: No module named pwd
"
captainhammy commented 4 years ago

So in a rather embarrassing turn of events it seems that my check out of the code was exceptionally old (like 2 years) and thus was missing a lot of new stuff such as the code where you are getting that error.

Unfortunately it appears I am using a linux only module in order to find out who owns a file and that's not gonna fly on Windows. There seem to be a few issues in regards to the node copy/paste functionality on Windows in addition to that import error. I don't know when I'll have the time to actual delve into the Windows specific issues (I basically never use Windows) but will try to soon. For now you can probably just comment out that line in the offending file and most things should work okay.

Another thing you will probably run into immediately after commenting it out is it barfing on other stuff (I know I did). One part that's not covered in the instructions is needing to install the various other Python libs via pip/requirements.txt. To do that you'll need Python + pip installed on your machine: https://www.liquidweb.com/kb/how-to-install-python-on-windows

When those are working you can just do the following:

D:\Houdini-Toolbox>pip install -r requirements.txt --user

That should install the required other modules.

MostHated commented 4 years ago

Ouch, lol. No worries, we have all been there in some form or another, lol.

I am a fairly proficient programmer myself (though my current project is partially to help learn Qt and Houdinis API, as this is my first time using either), so I could certainly dive in and make things work on my end, but that would not be helpful to you or others who might not be programmers, so I would much rather report the issues I come across "as-is", as that is what other people would experience as well.

I feel your pain, though. I have been working on a Houdini tool myself and in a few places I have been using the platform module and things such as the below:

if platform == "win32" or platform == "win64":
    import this
    dostuff()
elif platform == "linux" or platform == "linux2":
    import that
    dootherstuff()

I typically try to use Linux exclusively, but I use the Unity game engine and the Linux version has had some issues lately with some features that I really needed for my project and one of my animation tools doesn't have a Linux version yet, only Win/Mac, so I have been having to use Windows the last few weeks, which is ok in that it lets me get testing done on this platform, it's just annoying to have to switch back and forth, lol.

Don't feel like there is any rush on my account. I have only owned Houdini for 2 months and as I mentioned, I am trying to learn QT/Houdini, so I have been checking out all of the nicer Houdini addons to mostly see what kinds of things addons are capable of doing, and how people go about doing them, while also keeping track of which ones will be useful to me while actually using Houdini. I have been blown away by how awesome some of the tools I have come across have been, which inspires me, even more, to dive deeper and learn as much as I can.

That being said, this tool seemed like it had some pretty useful stuff, so I might dig into it this evening or tomorrow with the info you shared and see about getting things working so I can check out some of your work. 👍

Thanks, -MH

captainhammy commented 4 years ago

Sorry for the delay! Should be working better now.

MostHated commented 4 years ago

No worries, I have been wrapped up in my project. I did make the edits you mentioned and it was able to startup, but I didn't even look through everything yet. I will give it an update though to put things back the way they should be and give it another go.

Thanks, -MH

crystalthoughts commented 4 years ago

Hi, I'm also getting "ImportError: No module named ht.events" on startup! Here's my env:

RSPLUG = "C:/ProgramData/Redshift/Plugins/Houdini/18.0.348"
HTOOLB = "G:\Resources\3D\Houdini\Houdini-Toolbox\Houdini"
HTOOLBPY = "G:\Resources\3D\Houdini\Houdini-Toolbox\python"

HOUDINI_NVIDIA_OPTIX_DSO_PATH = C:/Users/Dan/Documents/houdini18.0\optix
HOUDINI_DSO_ERROR = 2
PATH = $RS;$PATH
HOUDINI_PATH = $HTOOLB;$RSPLUG;&
PYTHON_PATH = $PYTHONPATH;$HTOOLBPY

Did you figure out what had caused it before? I'm running windows too.

captainhammy commented 4 years ago

Hey danvenn. I'm guessing your problem is that you have an extra _ when trying to set your PYTHONPATH; you are using PYTHON_PATH instead of PYTHONPATH when you go to construct it.

crystalthoughts commented 4 years ago

Ah thanks for that. That was it.