Jump to content

How to install pywin32 in H12?


Recommended Posts

I am having issues installing this to Houdini. I download the python 2.6 version:

http://sourceforge.net/projects/pywin32/files/pywin32/Build%20217/

After install it on Python 2.6, I copied the folders under site-packages into C:\Program Files\Side Effects Software\Houdini 12.0.558\python26\lib

but when I try to import any module from that, I get a "no module named" error.

Am I missing something?

Link to comment
Share on other sites

Guest mantragora

Don't copy it to install folder. Try you "$HOME\scripts\python" folder instead. Or you can also try to import it from your python directory like in this WX library example link.

  • Like 1
Link to comment
Share on other sites

Guest mantragora

Are you sure it has to be win32 version ? If your Houdini is 64-bit than you got also 64-bit version of python and library will not work. There are also other reasons why it may not work.

  • Like 1
Link to comment
Share on other sites

Sorry I mentioned pywin32, but I think it's the name of the library. Otherwise I got the 64 version of it from the link I posted. But it still doesn't find it.

This whole copy pasting modules is very annoying, same thing with Maya. I was running similar issues all the time. Would be good if there is a robust way to do these.

Link to comment
Share on other sites

Guest mantragora

This link from my first post shows way to import without copying. First six lines of it.

There is problem with python on Windows. For example to make sure that "numpy" works you may have to compile library yourself. The same may be here.

  • Like 1
Link to comment
Share on other sites

Thanks I tried the stuff in your link but not sure what to put here:

wx_path = "/usr/lib/python2.6/site-packages/HERE"

import sys

if wx_path not in sys.path:

sys.path.append(wx_path)

so I just put win32, which is a folder in pywin32, but after that I couldn't import anything.

This is really strange.

Link to comment
Share on other sites

Guest mantragora

Just tried it and it works.

pywin_path = "C:\Python26\Lib\site-packages\pythonwin"
import sys
if pywin_path not in sys.path:
 sys.path.append(pywin_path)

if you don't know what to put "HERE" you can always check in standard shell where module is placed

import pywin
help(pywin)

  • Like 1
Link to comment
Share on other sites

Guest mantragora

if you don't know what to put "HERE" you can always check in standard shell where module is placed

import pywin
help(pywin)

Just like I said here. If you execute this code you get directory where "__init__.py" exists for this module. Just run CommandLine in Python mode or use one that comes with Python installation and run this code there.

>>> import pywin
>>> help(pywin)
Help on package pywin:

NAME
    pywin

FILE
    c:\python26\lib\site-packages\pythonwin\pywin\__init__.py


""" and the same for wx library ---------------------- ------------"""

>>> import wx
>>> help(wx)
Help on package wx:

NAME
    wx

FILE
    c:\python26\lib\site-packages\wx-2.8-msw-unicode\wx\__init__.py

This file is needed for directory to become python module. Check this info link.

Edited by mantragora
  • Like 1
Link to comment
Share on other sites

Thanks man, now it all makes sense. Although I went ahead now and tried to import win32clipboard and I get the same error.

win32clipboard is an existing module in pywin32:

http://docs.activestate.com/activepython/2.4/pywin32/win32clipboard.html

pywin_path = "C:\Python26\Lib\site-packages\pythonwin"

import sys

if pywin_path not in sys.path:

sys.path.append(pywin_path)

import pywin

help(pywin)

import win32clipboard

Link to comment
Share on other sites

Guest mantragora

Sorry, can't help with that. I thought that if I build library from source it will work, but it's not. It looks that hython and win32clipboard don't like each other.

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...