RSS Amplifier

Rida Ayed · Sep 30, 2020

Fix [Pyright] Import could not be resolved in emacs

0
Sign in to vote or save

This page cannot be shown here. You can still read it on the original site — the toolbar below keeps your place in the directory.

Say you open any python file containing an import. Your IDE is spacemacs and pyright . You might encounter this error: [Pyright] Import "anymodule" could not be resolved In order to get rid of this error, hit: , F a This launches lsp-workspaces-folders-add which requires you to enter the project’s path e.g. ~/tmp/mypython/ as workspace. I had only ~/tmp/ in the lsp-workspaces and thought it…

Say you open any python file containing an import. Your IDE is spacemacs and pyright. You might encounter this error:

[Pyright] Import "anymodule" could not be resolved

In order to get rid of this error, hit:

, F a

This launches lsp-workspaces-folders-add which requires you to enter the project’s path e.g. ~/tmp/mypython/ as workspace.

I had only ~/tmp/ in the lsp-workspaces and thought it is enough. Deleted this folder with: , F d .

Read on /posts/fixing_pyright_import_could_not_be_resolved_in_emacs/

Comments

Nothing yet. Say the first thing.

    Sign in to join the conversation.