Installing packages for pybricks-stubs, ev3dev2, rope and autopep8 Pro Preview

The pybricks-stubs package cooperates with Visual Studio Code's IntelliSense in providing programmers with information such as the next variable or function they could use and provides information on the written-out commands, such as their functions and input parameters.

The ev3dev2 adds extra commands for the EV3 brick. It depends on the ev3dev library, which is installed alongside the EV3 MicroPython Visual Studio Code extension. If you haven't installed EV3 MicroPython, due so before you proceed.

The Rope library allows us to automatically refactor our code. In this course, you will learn how to use this library to quickly edit variables, functions, etc

Autopep8 automatically formats code. There are standardized rules for how a well-written piece of code should be formated and this tool will help us follow them.

To access the full video please subscribe to FLLCasts.com

Subscribe

  • #1516
  • 24 Jan 2020

 

Installing Python packages

To install these packages, you need to enter a few commands in the computer console. Follow these steps:

  1. Press the Start button on your PC and type in "cmd";
     
  2. Launch the "Command Prompt" as an administrator by right-clicking on it with the mouse and then selecting "Run as administrator";
     
  3. A window may appear, either requesting your password or confirmation that you wish to start "Command Prompt" as an administrator. Confirm your choice and the Command Prompt will start:

    content picture
  4. First, we need to make sure we are using the latest version of pip. Pip is a package that allows us to use libraries outside of the standard Python installation. Enter the following command in the command prompt and press enter:

python -m pip install --upgrade pip

This process might take up to a minute depending on which version of pip you have to update to. Wait for the process to complete before you continue.
 

  1.  Install pybrick-stubs by entering the following command:
pip3 install pybricks-stubs

Wait for the process to complete before you continue.

 

  1. Install ev3dev3 by entering the following command:
pip3 install python-ev3dev2

Wait for the process to complete before you continue.

 

  1. Install rope by entering the following command:
pip install -U rope --user

Wait for the process to complete before you continue.

 

  1. Install autopep8 by entering the following command:
pip install -U autopep8 --user

Wait for the process to complete before you continue.

Courses and lessons with this Tutorial

This Tutorial is used in the following courses and lessons

Image for Python with LEGO Mindstorms EV3 - Level 1
  • 74
  • 28:18
  • 114