I'm trying to make PyLint automagically use correct conda environment inside vscode
but still getting import errors: [pylint] E0401:Unable to import 'django'
, although:
vscode
from correct environment. [1]
python.path
. [3]
In Visual Studio, right-click a Python project in Solution Explorer and select Python and then Run PyLint: This command prompts you to install PyLint into your active environment if it's not already present.
Select and activate an environment By default, the Python extension looks for and uses the first Python interpreter it finds in the system path. To select a specific environment, use the Python: Select Interpreter command from the Command Palette (Ctrl+Shift+P).
You have to install pylint
in this conda environment.
Activate given environment with activate env_name
(Windows) or source activate env_name
.
Install pylint
in this environment:
conda install pylint # or 'pip install pylint'
Finally, restart vscode.
Source: https://github.com/DonJayamanne/pythonVSCode/wiki/Troubleshooting-Linting
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With