Jump to content

import PyQt in Houdini


geminiPrevails

Recommended Posts

Hi, I looked for but couldn't find an answer to my question, so sorry if this has actually been answered before.

I am having a hard time having the PyQt4 library that is installed on my Win7 machine imported into houdini. When I try to run my code that includes an import command of PyQt4, I am getting:

ImportError: No module named PyQt4

I already have this path defined in my windows environment variables. One thing I am noticing though is: when I check out the sys.path inside python shell, there doesn't seem to be any of my windows global environment paths listed there. I guess the question I have is: how do I get them to be seen by Houdini?

Thanks!

Link to comment
Share on other sites

Guest mantragora

I'm not using PyQT so i can't check but as a temporary solution for your problem you can probably do

PyQT_path = "wherever_your_pyqt_is_installed" #probably something like "C:\Python26\Lib\site-packages\PyQT"
import sys
if PyQT_path not in sys.path:
sys.path.append(PyQT_path)

import pyqt_library_whatever_it_is_called_

in your script.

BTW. Are you sure you are setting correct variable? PYTHONPATH, right?

Edited by mantragora
Link to comment
Share on other sites

Hi, thanks for the reply. I considered doing that but I wasn't sure if it is good - or common - practice. Though it guards you against these surprises so I might give it a go.

Actually I think what is set in the windows variables for my python path is under the name "PATH", not "PYTHONPATH" so that might be cause of the problem. I will make sure to check it and let you know.

Thanks!

Link to comment
Share on other sites

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.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...