First I installed Mercurial from the installer on the home page, which is what they use for source control. I then pulled down all of the source code repositories found on Bitbucket here, with "hg clone".
In the crazyflie-pc-client repository, cd'ing to cfclient and attempting python ./cfclient.py resulted in:
No pyusb installation found, exiting!
Installing pyusb on OS X is easy:
sudo easy_install pyusb
Attempting to run it again results in another missing dependency error for pygame; first I attempted to resolve that with:
sudo easy_install pygame
However, that resulted in a bunch of errors, and I would up instead installing the binary package for Lion, available on the pygame website, which seemed to install OK.
The next dependency issue I hit was with PyQT4. I attempted to install the binaries for that as well, found on the PyQtX project.
Unfortunately, attempting to install that resulted in an error: "Python 2.7 from official python website is not installed.".
The version of Python on my machine (OS X Lion, Version 10.7.5) is:
So I'm not sure why PyQT4 was complaining, but I went ahead and installed the latest stable 2.7.x Python release (Python 2.7.3 Mac OS X 64-bit/32-bit x86-64/i386 Installer):
Which appeared to install "python2.7-32", the only 2.7.3 version of Python I could find in my path.
Next, the PyQT4 install finally was able to be started, but it indicated that it requires the Qt Libraries to be installed - specifically, 4.8.2. I found some versions on the Qt Project home page, but the closest was 4.8.4.
I installed the 4.8.4 version of Qt, then continued with the PyQT4 install, and finally PyQT4 appeared to have installed successfully, with an ugly confirmation dialog:
Now back to cfclient. Attempting to run again with 2.7.3 resulted in this:
$ python2.7-32 ./cfclient.py
Traceback (most recent call last):
File "./cfclient.py", line 74, in <module>
from ui.main import MainUI
File "/Users/mikevoyt/Development/repositories/crazyflie/crazyflie-pc-client/cfclient/ui/main.py", line 36, in <module>
from PyQt4 import Qt, QtCore, QtGui, uic
ImportError: dlopen(/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/PyQt4/Qt.so, 2): no suitable image found. Did find:
/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/PyQt4/Qt.so: mach-o, but wrong architecture
This had me stumped a bit; 'python -V' was still showing 2.7.1 while 'python2.7-32 -V' seemed to be the only version of Python I had installed showing 2.7.3. Well it turns out the '-32' is the 32-bit version (duh), and the PyQt4 binary only supports the 64-bit version. I found the 64-bit version along with the other versions here:
The version of 'python2.7' in my path was pointing to a binary in /System/Library/Frameworks, which explains why it was still back at 2.7.1 (so apparently all of the pre-installed Python versions are in /System, while the install put the new versions in /Library).
So after moving /usr/bin/python off to the side, and creating a simlink to the new version in /usr/bin:
sudo ln -s /Library/Frameworks/Python.framework/Versions/2.7/bin/python
finally, "pyton ./cfclient.py" finally brought up the UI!
So after a few hours of downloading libraries, Googling, poking around, and some luck, I was finally able to run the Python client app on OS X. This is one of the reasons it'd be nice to create a native OS X app (with maybe a very lightweight Pyton library for communications) for controlling the device. For now though this should be a good place to start figuring out how stuff works.