perforce p4python module with Houdini's python problem

   7288   2   2
User Avatar
Member
2 posts
Joined: Jan. 2016
Offline
Hi,

does anybody use the Perforce python package within Houdini? I am trying to use the perforce python package p4python, see here:

https://www.perforce.com/perforce/doc.current/manuals/p4script/03_python.html [perforce.com]

On OSX I just pip installed the package like this:

sudo pip install p4python

and now within Houdini I can import the module in any python code like this:

import P4


But on windows I am running into trouble! I have a python version installed on a system level (not the one that comes with Houdini). I am able to install p4python there with no problem (also using pip). I can then import the module in python just fine. But when I am installing it under the houdini python, the import fails. I tried several ways.

Here is one of the things I tried:

in a cmd shell:
<path-to-houdini-installation>\bin\hython -m pip install p4python

it seems to install fine. I can now see the P4.py and the P4API.pyd files under the site-packages directory under the houdini python (2.7). But if I now try within Houdini to do an “import P4” it fails saying:

…P4.py, line 410, in <module> import P4API
importError: DLL load failed: The specified module could not be found.

even thou P4API.pyd is right there!

I don't get it. It works just fine on the Mac OS X and it works just fine in any “normal” python installation on windows. But it does not work with Houdini's python. Any ideas?

Using Houdini 15
User Avatar
Member
338 posts
Joined: Sept. 2006
Offline
p4python isnt binary compatible with the version of python in houdini and maya,
If i remember correctly the maya 2015 build here works.

http://www.robg3d.com/maya-windows-binaries/ [robg3d.com]

Hope that helps
Cheers
Nick
User Avatar
Member
1 posts
Joined: April 2015
Offline
ah thanks!!

I can confirm it is indeed a problem with the compiler version. Houdini's python seems to be compiled with:

MSC v.1700 64 bit (AMD64) (VC 2012)

while a default python was compiled with:
MSC v.1500 64 bit (AMD64) (VC 2008)

using a .pyd that was complied with the right version is fixing the issue! Turns out Maya TDs are facing the same problems. Found this forum:
http://tech-artists.org/forum/archive/index.php?t-4616.html [tech-artists.org]
  • Quick Links