Install for Python
The RDK Python library is packed into a Python package named flexivrdk
, which can be installed using pip
on all supported platforms.
Install dependencies
Use pip
module to install the required dependencies for a specific version of Python:
python3.x -m pip install numpy spdlog
Replace 3.x
with a specific Python version, e.g. 3.10.
Install RDK library
Use pip
module to install RDK library for a specific version of Python:
python3.x -m pip install flexivrdk
Use the installed library
After the library is installed as flexivrdk
Python package, it can be imported from any Python script. Test with the following commands in a new Terminal, which should start Flexiv RDK:
python3.x
import flexivrdk
robot = flexivrdk.Robot("Rizon4-123456")
The program will start searching for a robot with serial number Rizon4-123456
, and will exit after a couple of seconds if the specified robot is not found in the local network.
Reference - Install multiple versions of Python
Linux
To install different versions of Python alongside the system’s native Python, add and use a personal package archive (PPA):
sudo apt install software-properties-common
sudo add-apt-repository ppa:deadsnakes/ppa
sudo apt update
sudo apt install python3.x
When done, this specific version of Python can be invoked from Terminal using python3.x
:
python3.x --version
However, the commands above do not install the pip
package manager for this Python 3.x and it needs to be manually installed:
wget https://bootstrap.pypa.io/get-pip.py
python3.x get-pip.py
Once it’s finished, you can install a Python package discoverable by the PPA-installed Python 3.x via:
python3.x -m pip install <package_name>
Warning
The sudo apt install python3-pip
command only installs pip
for the system’s native Python, and Python packages installed using this pip
is not discoverable by other versions of Python.
macOS
To install different versions of Python alongside the system’s native Python, use Homebrew package manager:
brew install python@3.x
Replace “3.x” with the actual Python3 version you wish to use. When done, this specific version of Python can be invoked from Terminal using python3.x
:
python3.x --version
The package manager module pip
for this version of Python will also be installed automatically.
Windows
To install different versions of Python alongside each other, use Microsoft Store. When done, a specific version of Python can be invoked from Terminal using python3.x
:
python3.x --version
The package manager module pip
for this version of Python will also be installed automatically.