The problem is that, when I try to add an extension for Pylint in Visual Studio Code, I get a pretty long error message
C:/Users/username/AppData/Local/Programs/Python/Python39/python3.exe
c:\Users\username\.vscode\extensions\ms-python.python-2020.10.332292344\pythonFiles\pyvsc-run-isolated.py pip install -U pylint --user
C:\Users\username\AppData\Local\Programs\Python\Python39\python3.exe:
can't open file
'C:\Users\username\Documents\Programming\Python\beginning
in vscode\Usersname.vscodeextensionsms-python.python-2020.10.332292344pythonFilespyvsc-run-isolated.py': [Errno 2] No such file or directory
It looks like the final part of the error message involves a path that is lacking any slashes. Where do I go to fix that path, so I can install the extension?
It is hard to say where the problem comes from, but it's probably some misconfiguration in Visual Studio Code.
You can also install Pylint manually. Use that python.exe
which you use in your project. If you use a virtual environment, use the python.exe
inside it (in the venv/Scripts
folder). However, it seems that you are using your global Python instance, which is also fine, but note that if you activate a virtual environment in Visual Studio Code Terminal, you'll have to also install Pylint for that virtual environment.
The command is
<path_to_python> -m pip install pylint
Now since you use your global Python interpreter, you can just
python -m pip install pylint
if you wish. It will install the Pylint package to the current environment, be it the global environment or a virtual environment. More precise would be the same Python as Visual Studio Code tried:
C:/Users/username/AppData/Local/Programs/Python/Python39/python3.exe -m pip install pylint --user