Up to mavericks I had all my openstack python clients installed and working on my mac. However, after the upgrade to yosemite I started to get some errors about some missing libraries.
After spending more time than I would have liked I managed to get the python openstack clients working again.
Remove older versions of python
- rm -rf /Library/Frameworks/Python.framework/Versions/2.7
- rm -rf "/Applications/Python 2.7"
- rm /usr/bin/python
- brew rm python
Update python version
The latest available version up to this time of writing was 3.4
After the installation is completed make sure to update the Current symlink
- ln -s /Library/Frameworks/Python.framework/Versions/3.4 /Library/Frameworks/Python.framework//Versions/Current
and the python symlink:
- ln -s /Library/Frameworks/Python.framework/Versions/3.4/bin/python3.4 /usr/bin/python
Update dependencies symlinks
Also needs to update symlinks for pip and easy_install
- ln -s /Library/Frameworks/Python.framework/Versions/3.4/bin/pip3.4 /usr/bin/pip
- ln -s /Library/Frameworks/Python.framework/Versions/3.4/bin/pip3.4 /usr/local/bin/pip
- ln -s /Library/Frameworks/Python.framework/Versions/3.4/bin/easyinstall-3.4 /usr/bin/easyinstall
- ln -s /Library/Frameworks/Python.framework/Versions/3.4/bin/easyinstall-3.4 /usr/local/bin/easyinstall
Libffi is a dependency for the python-glanceclient. If the lib is not present you might get an error like this:
/usr/bin/clang -fno-strict-aliasing -fno-common -dynamic -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -arch i386 -arch x8664 -g -I/usr/include/ffi -I/usr/include/libffi -I/Library/Frameworks/Python.framework/Versions/3.4/include/python3.4m -c c/cffibackend.c -o build/temp.macosx-10.6-intel-3.4/c/cffi_backend.o
c/cffibackend.c:13:10: fatal error: 'ffi.h' file not found
1 error generated.
Note: will not use '__thread' in the C code
The above error message can be safely ignored
error: command '/usr/bin/clang' failed with exit status 1
To install the libffi I used brew:
- brew install libffi
PBR is also another dependency for the python-glanceclient, without PBR you might get an erro message like the following:
$ glance --help Traceback (most recent call last):
File "/Library/Frameworks/Python.framework/Versions/3.4/bin/glance", line 6, in <module> from glanceclient.shell import main File "/Library/Frameworks/Python.framework/Versions/3.4/lib/python3.4/site-packages/glanceclient/init_.py", line 24, in
import pbr.version ImportError: No module named 'pbr'
To install PBR:
- pip install pbr
Finally, install the clients
Don't forget to export the PKGCONFIGPATH which will include the dir of the libffi installed with bew:
- export PKGCONFIGPATH when running the install command sudo PKGCONFIGPATH=/usr/local/Cellar/libffi/3.0.13/lib/pkgconfig/ python setup.py install