How To Install python3-parso on Debian 10

Learn how to install python3-parso on Debian 10 with this tutorial. python3-parso is Python parser that supports error recovery - Python 3.X

Introduction

In this tutorial we learn how to install python3-parso on Debian 10.

What is python3-parso

python3-parso is:

Parso is a Python parser that supports error recovery and round-trip parsing for different Python versions (in multiple Python versions). Parso is also able to list multiple syntax errors in your Python file.

Parso has been battle-tested by jedi. It was pulled out of jedi to be useful for other projects as well.

Parso consists of a small API to parse Python and analyse the syntax tree.

A simple example:

import parso module = parso.parse(‘hello + 1’, version=“3.6”) expr = module.children[0] expr PythonNode(arith_expr, [<Name: hello@1,0>, <Operator: +>, <Number: 1>]) print(expr.get_code()) hello + 1 name = expr.children[0] name <Name: hello@1,0> name.end_pos (1, 5) expr.end_pos (1, 9)

To list multiple issues:

grammar = parso.load_grammar() module = grammar.parse(‘foo +\nbar\ncontinue’) error1, error2 = grammar.iter_errors(module) error1.message ‘SyntaxError: invalid syntax’ error2.message “SyntaxError: ‘continue’ not properly in loop”

There are three methods to install python3-parso on Debian 10. We can use apt-get, apt and aptitude. In the following sections we will describe each method. You can choose one of them.

Install python3-parso Using apt-get

Update apt database with apt-get using the following command.

sudo apt-get update

After updating apt database, We can install python3-parso using apt-get by running the following command:

sudo apt-get -y install python3-parso

Install python3-parso Using apt

Update apt database with apt using the following command.

sudo apt update

After updating apt database, We can install python3-parso using apt by running the following command:

sudo apt -y install python3-parso

Install python3-parso Using aptitude

If you want to follow this method, you might need to install aptitude first since aptitude is usually not installed by default on Debian. Update apt database with aptitude using the following command.

sudo aptitude update

After updating apt database, We can install python3-parso using aptitude by running the following command:

sudo aptitude -y install python3-parso

How To Uninstall python3-parso on Debian 10

To uninstall only the python3-parso package we can use the following command:

sudo apt-get remove python3-parso

Uninstall python3-parso And Its Dependencies

To uninstall python3-parso and its dependencies that are no longer needed by Debian 10, we can use the command below:

sudo apt-get -y autoremove python3-parso

Remove python3-parso Configurations and Data

To remove python3-parso configuration and data from Debian 10 we can use the following command:

sudo apt-get -y purge python3-parso

Remove python3-parso configuration, data, and all of its dependencies

We can use the following command to remove python3-parso configurations, data and all of its dependencies, we can use the following command:

sudo apt-get -y autoremove --purge python3-parso

Dependencies

python3-parso have the following dependencies:

References

Summary

In this tutorial we learn how to install python3-parso package on Debian 10 using different package management tools: apt, apt-get and aptitude.