Jump to content

[SOLVED]Using Module From Another Python Version?


Atom

Recommended Posts

Hi All,

 

I am trying to use a python module that was compiled against python 3.4. Houdini is running on 2.7.5 so when I import this module I get an error.

 

Is there a work around for this?

Or do I have to write this module off and not use it?

 

 

Thanks

Edited by Atom
Link to comment
Share on other sites

The module can't be used directly but you could do something like pipe data out of Houdini, through the script, and then back again. It's a bit of a kludge though. What does the module do? It's unusual these days for a module to not support Python 2 and only support Python 3 unless it's a brand new module that didn't exist before.

Link to comment
Share on other sites

The module is the pyluxcore module which is an open source render engine. It is the new incarnation of the LuxRender system. It is compiled against python 3.4. The developers mentions something about a technology called python boost that may help bridge the gap? They also mention I could re-compile the source myself, which is beyond my means. I prefer to use software that is compiled and done.

 

Just checking if there was an easy work around.

Edited by Atom
Link to comment
Share on other sites

Sure, here is a screen shot.

 

The open source render engine is available here from the daily builds.

The test code I am using is the example code on the LuxCore site.

I solved the import pathing issue by pointing it directly to my LuxRender folder prior to the import attempt. This got me past the first error of module not found to the next error which is shown in the image.

sys.path.append("C:/Program Files/LuxRender/LuxCore")
Code snippet so you can see line #6.

import time
import sys
from array import *
sys.path.append("C:/Program Files/LuxRender/LuxCore")

import pyluxcore    # This is line #6.

pyluxcore.Init()

print("LuxCore %s\n" % pyluxcore.Version())
NOTE: I pasted the example code into a Toolshelf button. I am not running this from the Python Source editor or Shell.

post-12295-0-61378000-1455900791_thumb.j

Edited by Atom
Link to comment
Share on other sites

That's unfortunate. I was thinking if it was getting caught on something like print "" versus print("") it could be tweaked but that looks like a deeper problem. I'd ask SESI to move to Python 3 soon and use this as a real world case where it's now a problem to be using Python version that old. Python 3 has been out for 8 years at this point and Python 2 is maintenance only. New features are being added to Python 3.

Link to comment
Share on other sites

SESI goes by http://www.vfxplatform.com/ these days for versions of most everything.  I can't see them updating to 3.x unless the platform heads that way.  I also can't imagine a huge interest in the industry to go above 2.7.x any time soon give the sheer amount of work every studio and application would have to do to update their code.

 

Hell, we're still running 2.6 here... :(

Link to comment
Share on other sites

SESI goes by http://www.vfxplatform.com/ these days for versions of most everything.  I can't see them updating to 3.x unless the platform heads that way.  I also can't imagine a huge interest in the industry to go above 2.7.x any time soon give the sheer amount of work every studio and application would have to do to update their code.

 

Hell, we're still running 2.6 here... :(

 

That's a shame. Python 3 has been out in the wild for 8 years and has a lot of great new features. To put that in context Bush was still president of the United States when Python 3 was released. The last Python 2 major release was 6 years ago. Ubuntu and Fedora are moving to Python 3 as the default in the next release. Okay, rant over.

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