This is a setup guide of toio.py (library for controlling toio™Core Cube from Python).
- Windows: Windows10 (22H2)
- Windows: Windows11 (23H2)
- Linux: Ubuntu24.04
- macOS: macOS 14(Sonoma)
- iOS, iPadOS: 17
Install Python (Recommended version is 3.11 or later)
Install Python by referring to Using Python on Windows. Recommended version is Python 3.11 or later.
Open a command prompt.
Type the following command to install these Python packages.
Update setuptools to latest.
python -m pip install setuptools --upgrade
python -m pip install typing-extensions
python -m pip install bleak
Execute the following command to install.
python -m pip install toio-py --upgrade
python -m pip install ipykernel
Confirmation
Execute the following command at the command prompt.
python -c "import toio.scanner; print('ok')"
If you see ok
, toio.py has been successfully installed.
If you get an ImportError, the installation did not work. If you try to install toio.py again, and it does not work Try reinstalling Python.
For reference: ImportError message
If you get this message, you have failed to install.
Traceback (most recent call last):
File "<string>", line 1, in <module>
ModuleNotFoundError: No module named 'toio.scanner'
Install Visual Studio Code
Refer to Python in Visual Studio Code to install Visual Studio Code and Python Extensions.
After the Python extension installed, install the Jupyter extension.
Search for Jupyter
using the same procedure as for installing Python extensions.
Install the following Jupyter extensions from Microsoft
Download tutorial.en.py.
Open tutorial.py
on Visual Studio Code.
The tutorial can be read while actually executing code using Visual Studio Code's Code Cell feature.
Visual Studio Code has the ability to execute partial Python code in the document individually (code cell executor).
When you open tutorial.py, you will see the text separated by several blue horizontal lines, as shown in the following screenshot.
The area delimited by the blue line is a single code cell.
Click on the words Run Cell
in the upper left corner to run a single code cell.
Enlarged view of the Run Cell
section.
Additional Information: If you do not see Run Cell
If Visual Studio Code is running in Restricted Mode, the Code Cell feature will not work. If you see Restricted Mode in the lower left corner of the Visual Studio Code window, click on the Restricted Mode text and set the window to Trusted Window.
Restricted Mode
Trusted Window Setup Screen
The results of the execution of the code cell are displayed on the right side.
When other code cells are executed, the results of the execution of those code cells are added.
The API document is here.