- You can download the SDK from SoftBank Robotics for the latest version of the SDK OR from the following repository for robots older than NAO Power V6:
git clone https://github.com/cristianrubioa/pynaoqi-installation-for-mac
- Extract Python SDK:
Note: In case of downloading from the repository, go to the third step.
tar -xzvf pynaoqi-python-2.7-naoqi-x.x-mac64.tar.gz
mv pynaoqi-python-2.7-naoqi-x.x-mac64 pynaoqi
- Add environment variables:
export PYTHONPATH=${PYTHONPATH}:/path/to/python-sdk/lib/python2.7/site-packages
export DYLD_LIBRARY_PATH=${DYLD_LIBRARY_PATH}:/path/to/python-sdk/lib
export QI_SDK_PREFIX=/path/to/python-sdk
- Run the following command on your terminal:
open ~/.bash_profile
- To make it use globally, copy the commands from Step-3 and paste it in
.bash_profile
, for example:
export PYTHONPATH=${PHTHONPATH}:/Users/admin/Documents/pynaoqi/lib/python2.7/site-packages
export DYLD_LIBRARY_PATH=${DYLD_LIBRARY_PATH}:/Users/admin/Documents/pynaoqi/lib
export QI_SDK_PREFIX=/Users/admin/Documents/pynaoqi
-
Save the file and close the editor
.bash_profile
. -
Force the execution of the .bash_profile file to see the changes immediately without having to restart:
source ~/.bash_profile
Open the terminal and try to run:
python
>>> import naoqi
>>>
Note: If you do not get any error message, you are now ready to use the Python SDK.
Try these scripts to start: https://github.com/cristianrubioa/nao_robot