# Fix the 'Unable to import django.db' error in VS Code

> Fix the 'Unable to import django.db' pylint error in VS Code by running Python: Select Interpreter and choosing your project's virtual environment.

Author: [Flavio Copes](https://flaviocopes.com/about/) | Published: 2021-04-04 | Topics: [Python](https://flaviocopes.com/tags/python/) | Canonical: https://flaviocopes.com/error-unable-import-django-db/

While working on a Django app in [VS Code](https://flaviocopes.com/vscode) you might run into a problem. VS Code underlines the `from` keyword in an import, and if you hover it with the mouse you will see the error `Unable to import 'django.db' pylint(import-error)` showing up.

This is because VS Code is not running the Virtual Environment of the app.

To fix it, run `cmd-shift-p` (or click `View -> Command Palette` and run the command **[Python](https://flaviocopes.com/python-introduction/): Select Interpreter**.

![VS Code command palette showing Python: Select Interpreter command highlighted at the top](https://flaviocopes.com/images/error-unable-import-django-db/Screen_Shot_2021-01-03_at_17.23.42.png)

VS Code will show you a list of Python interpreters found.

![List of Python interpreters showing multiple Python versions and virtual environment options](https://flaviocopes.com/images/error-unable-import-django-db/Screen_Shot_2021-01-03_at_17.23.02.png)

Choose the one corresponding to your virtual environment, in this case the last option.

The error will disappear.
