I'd like to build SimpleITK from source and install it for Python 3.4 (on Ubuntu 14.04).
I followed SimpleITK's build instructions, i.e.
git clone http://itk.org/SimpleITK.git
mkdir SimpleITK-build
cd SimpleITK-build
cmake ../SimpleITK/SuperBuild
and that worked fine. I was able to install SimpleITK for Python 2.7 using sudo python setup.py install
. I then tried to install it for Python 3.4, using sudo python3.4 setup.py install
, and although it seemed to install correctly, when I tried to import SimpleITK in Python 3, I got:
...
File "/usr/lib/python3.4/imp.py", line 243, in load_module
return load_dynamic(name, filename, file)
ImportError: dynamic module does not define init function (PyInit__SimpleITK)
In the build instructions above, it says:
Verify and/or correct the advanced cmake variables to the language specific executable, libraries and include directories. For example if you have multiple Python installations ensure that all related Python variable refer to the same versions.
I didn't do that, and I suspect that's why it will only work for Python 2.7. How do I correct the "advanced cmake variables"?