UPDATE AGAIN (October 2021)
Houdini 19.5 has been released and the default version runs on python 3. You might have to go to the python39 folder instead of the python37 now.
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.
Special: M1 CPU installation guide
Note that SideFX provides an M1 version of Houdini.
- Place “get-pip.py” somewhere (this is the same file as on your website).
- Navigate to the “/Applications/Houdini/Houdini19.0.455/Utilities” directory. (This assumes Houdini is installed in the default location, otherwise navigate to the analogous location.)
- Double-click the “Houdini Terminal 19.0.455.app” to open the Houdini shell.
- Install pip with the command “hython /path/to/get-pip.py”.
- Install Scipy with the command “hython -m pip install scipy”
MacOS non-M1 script
(credit to S. Wang) Replace Houdini19.5.303 with whatever version you have. See the script on this link.
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
import scipy.sparse as sp
import scipy.sparse.linalg as la
Using Scipy
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.
1 2 3 4 5 6 7 8 9 10 11 |
from scipy.sparse import csr_matrix import numpy as np import math ### get geometry node = hou.pwd() geo = node.geometry() # continue with your normal python code # ... # ... |