Set up Python development with extensions and linting tools
This guide was heavily inspired by Jack Fields and his article about setting up VS Code for Python development. Please check his article for more details.
The following extensions setup Cursor to be fully featured for Python development. These provide you with syntax highlighting, linting, debugging and unit testing.
While the above extensions have previously been the most popular extensions for Python development in Cursor, we’ve also added some additional extensions that can help you get the most out of your Python development.
uv is a modern Python package manager that can be used to create and manage virtual environments, in addition to replacing pip as the default package manager.To install uv, run the following command in your terminal:
Ruff is a modern Python linter and formatter that can be used to check for programming errors, helps enforce coding standards, and can suggest refactoring. It can be used alongside Black for code formatting.To install Ruff, run the following command in your terminal:
Black is a code formatter that automatically formats your code to follow a consistent style. It requires zero configuration and is widely adopted in the Python community.
To install Black, run the following command in your terminal:
Copy
Ask AI
pip install black
Then, configure Cursor to use Black for code formatting, by adding the following to your settings.json file:
We can use PyLint to check for programming errors, helps enforce coding standards, and can suggest refactoring.To install PyLint, run the following command in your terminal: