Which version of Python is best to work with H16 and forward?

   4715   6   2
User Avatar
Member
13 posts
Joined: Feb. 2017
Offline
I'm just getting started with Python scripting and wanted to know should I use Python 2.7 or 3.X. I've only just started using Houdini so I have no backwards compatibility issues with any version less than the current H16. I'd prefer to use 3.x since it appears that 2.7 is essentially a maintenance mode and there are other things I want to do with Python where 3.x is definitely the way to go.
“What we do for ourselves dies with us. What we do for others and the world remains and is immortal.”
Albert Pike
User Avatar
Member
2042 posts
Joined: Sept. 2015
Offline
I'm hoping somebody will chime in here because I may be wrong.

I think it's best to go with what's version is installed.

Reason being is I believe there are parts of Houdini that use python whether or not you write your own scripts or expressions. So you might run into issues.

And not to hi-jack your thread…but I was curious.

Couldn't find anything in docs…so I did “hconfig -a” and it's showing :

HOUDINI_PYTHON_VERSION := `<not defined>`

So I pulled up python shell and it's showing 2.7.5

Then again going into the folder on my system

Houdini 16 > python27

I'm seeing a python.exe and python2.7.exe but no python2.7.5.exe
User Avatar
Member
13 posts
Joined: Feb. 2017
Offline
Ok… this is good to know.

I'll have to scout around…. I'm thinking there has to be a way to run both versions on a machine and my “guess” is I simply have a shell script (or batch script for windows) that changes environment variables between 2.7 and 3.x depending upon what I wish to do. I use both OSX on my MacBookPro and my main workstation is a Windows 10 machine so what ever I do I need to figure a way to do this on both machines.

Thanks for the info.
“What we do for ourselves dies with us. What we do for others and the world remains and is immortal.”
Albert Pike
User Avatar
Staff
1256 posts
Joined: July 2005
Offline
Hello,

If you wish to execute Python scripts in Houdini 16 then you have to use Python 2.7 since that is what Houdini is built against.

Python 3.x support in Houdini is at least 1-2 years away and even when 3.x support is added there will still be a transition period where Houdini will support 2.7 as well.

Cheers,
Rob
User Avatar
Member
32 posts
Joined: Nov. 2017
Offline
rvinluan
Python 3.x support in Houdini is at least 1-2 years away and even when 3.x support is added there will still be a transition period where Houdini will support 2.7 as well.

I know this is an old thread, but is there any news on python3 support in Houdini 17? Since Python2 is being end-of-lifed very soon (https://pythonclock.org/) I'm hoping not to build my new tooling around it.
User Avatar
Staff
1256 posts
Joined: July 2005
Offline
garyo
I know this is an old thread, but is there any news on python3 support in Houdini 17? Since Python2 is being end-of-lifed very soon (https://pythonclock.org/) I'm hoping not to build my new tooling around it.

Hello,

There are no plans to bring Python 3 support to Houdini 17.0 or 17.5.

Our goal is to follow the VFX Reference Platform (http://vfxplatform.com/) and ideally have a tech preview (i.e. not production ready) Python 3 build later this year for the next major Houdini release and an official build next year.

Cheers,
Rob
User Avatar
Member
32 posts
Joined: Nov. 2017
Offline
OK, good to know. Thanks! (I know there's been a lot of discussion around when the VFX reference platform would move to python3. It's been a pain point for a lot of folks.)
  • Quick Links