Jump to content
Sign in to follow this  
geminiPrevails

import PyQt in Houdini

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!

Share this post


Link to post
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

Share this post


Link to post
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!

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
Sign in to follow this  

×