Today’s adventure is on the Mac OSX Mavericks, we tried to install OpenStack client tools and had some failures. Read on to see how we work around it.
The problem? On a brand-new OSX Mavericks tried to follow the instructions from the standard Guide at http://docs.openstack.org/user-guide/content/install_clients.html.
Presumably, this is very simple. Just use commands like:
sudo pip install python-novaclient
pip command works fine…but when you run any of the clients, you get the following type of error:
isgmj2chg3qp:~ n75029$ nova Traceback (most recent call last): File "/usr/local/bin/nova", line 7, in
from novaclient.shell import main File "/Library/Python/2.7/site-packages/novaclient/__init__.py", line 18, in __version__ = pbr.version.VersionInfo('python-novaclient').version_string() File "/Library/Python/2.7/site-packages/pbr/version.py", line 78, in version_string for part in self.release_string().split('.'): File "/Library/Python/2.7/site-packages/pbr/version.py", line 70, in release_string self.release = self._get_version_from_pkg_resources() File "/Library/Python/2.7/site-packages/pbr/version.py", line 62, in _get_version_from_pkg_resources return packaging.get_version(self.package) File "/Library/Python/2.7/site-packages/pbr/packaging.py", line 870, in get_version raise Exception("Versioning for this project requires either an sdist" Exception: Versioning for this project requires either an sdist tarball, or access to an upstream git repository. Are you sure that git is installed?
The Solution – Long-Term
This is a known bug – see https://bugs.launchpad.net/pbr/+bug/1369179. The problem is strictly related to how the software is installed and interactions between the
pbr (Python Build Reasonableness – see http://docs.openstack.org/developer/pbr/) packages. It will be fixed either in the OpenStack Juno or Kilo releases.
The basic problem is that the Python
pbr module is looking to read the package version information only from the PKG-INFO file, which is not present when you use the
pip install pattern recommended by OpenStack. While
pbr will be fixed to look for package version information from the METADATA file as well as the PKG-INFO file, short-term we need a solution.
The answer is easy but a bit time-consuming: install from source.
Before you start to think that this is not a good idea, keep in mind that “source” is simply Python code. Which is all that
pip would do; we’re just doing the steps manually. Because we are installing from source, the PKG-INFO file is created and installed in the application folders like
/Library/Python/2.7/site-packages/novaclient and everything works.
To do the install:
- Pull down the package you want. You can find them at the Python Package Index at https://pypi.python.org/pypi. Simply search for the OpenStack client package name like
python-novaclientand you’ll find the page you want. It will come down as a
- Be sure to start with the
pbrpackage. First uninstall it if it is there:
sudo pip uninstall pbr
Then uncompress the downloaded package; I used:
tar xzf pbr-0.10.0.tar.gz cd pbr-0.10.0 sudo python ./setup.py install
That’s it. The
pbrpackage is now installed.
- Repeat the above pattern for each of the OpenStack client tools. For example:
tar xzf python-novaclient-2.20.0.tar.gz cd python-novaclient-2.20.0 sudo python ./setup.py install
And now, when you run the client tools they will work OK:
isgmj2chg3qp:openstack-client n75029$ nova --version 2.20.0