UPDATE AGAIN (November 2021)
Houdini 19.0 has been released and the default version runs on python 3. The tutorial below still works but you don’t have to search for the special python 3 daily builds.
MAJOR UPDATE (May 2020):
Houdini is moving from python 2 to python 3. We recommend using python 3 because, finally, this enables us to run Scipy inside of Houdini again. The previous installation guide can be found below the current guide.
MICROSOFT WINDOWS INSTALLATION GUIDE:
- Install a Houdini version containing python3. Currently: Check out the daily builds website and grab the Python 3 Tech Preview (or the next full Houdini release once python3 becomes default).
- Download get-pip.py from [bootstrap.pypa.io] (save as a file) and place it in your Houdini python37 folder (e.g. C:\Program Files\Side Effects Software\Houdini 18.0.456\python37).
- Run windows cmd with admin rights and navigate to your python folder (e.g. cd “C:\Program Files\Side Effects Software\Houdini 18.0.456\python37”).
- Execute the command “python3.7.exe get-pip.py” and wait for pip to finish installing. pip.exe should now appear in the /Scripts folder.
- Execute the command “python3.7.exe -m pip install scipy” and wait for Scipy to install.
- Finished! Your Houdini should now work with scipy. No restarting of Houdini required.
MAC AND LINUX INSTALLATION GUIDE:
Analog to the version above. A specific description is coming soon after testing.
TESTING IF SCIPY WORKS:
Just place a python node and insert the following code:
# if you get no error messages for importing these
# SciPy packages then your SciPy works!
import scipy.sparse as sp
import scipy.sparse.linalg as la
SideFX has removed 16.5 from the daily builds page. If you want Houdini 16.5 you now have to go to ftp://ftp.sidefx.com/public/Houdini16.5/.
INSTALLATION GUIDE FOR Houdini 16.5 or lower.
Only follow these instructions if you have to use Houdini 16.5 or lower. We very much recommend sticking to the up to date way of installing Scipy in Houdini with python3.
Note1: this works with Houdini 16.5. Other Houdini versions have not been confirmed by us yet, but it should work.
Note2: For windows, this way of installing scipy does not function anymore with Houdini 17. Please follow this post: https://www.sidefx.com/forum/topic/58442/
To get older version of Houdini take a look at the daily builds page from SideFX.
Notes3: The newest version of Anaconda2 does not work even with version before Houdini 17. For windows users we now recommend installing Houdini 16.5 from the official distribution and installing Anaconda2-2.4.0-Windows-x86_64.exe from the official distribution. Completing the instructions of this post with with the above mentioned files should make this work.
MICROSOFT WINDOWS INSTALLATION GUIDE:
Window’s version of Houdini has its own’s version of python installed and does not use the default python location. Houdini uses python 2.7, NOT python 3.6. Make sure that you install the right scipy version. In anaconda for example, avoid the python 3.6 download.
Then go into the anaconda directory that is usually:
and copy all the files from there into the Houdini python directory
Scipy should now work fine.
Courtesy for the following Mac and Linux guides go to Chern et. al.
Mac Installation Guide
You don’t need to do anything. Mac already has SciPy.
Linux Installation Guide
Install SciPy from http://www.scipy.org/install.html. In particular it is recommended to install the Anaconda pack version 2.7. On Linux, Houdini ’s internal Python will read the Python library installed on your machine.
A great reason to use scipy will be the scipy sparse methods that speed up the matrix processing. A python node with scipy will be able to import scipy commands as seen in the code below with sparse.
from scipy.sparse import csr_matrix
import numpy as np
### get geometry
node = hou.pwd()
geo = node.geometry()
# continue with your normal python code