Visual Studio Code не может установить Pylint - PullRequest
0 голосов
/ 22 сентября 2019

После создания новой среды conda Visual Studio Code просит установить pylint : enter image description here

Если я нажму Install , онапроисходит сбой из-за ограничений доступа:

"C:/Program Files (x86)/Microsoft Visual Studio/Shared/Anaconda3_64/envs/derm-ai/python.exe" -m pip install -U pylint
Collecting pylint
  Using cached https://files.pythonhosted.org/packages/60/c2/b3f73f4ac008bef6e75bca4992f3963b3f85942e0277237721ef1c151f0d/pylint-2.3.1-py3-none-any.whl
Collecting colorama; sys_platform == "win32" (from pylint)
  Using cached https://files.pythonhosted.org/packages/4f/a6/728666f39bfff1719fc94c481890b2106837da9318031f71a8424b662e12/colorama-0.4.1-py2.py3-none-any.whl
Collecting isort<5,>=4.2.5 (from pylint)
  Using cached https://files.pythonhosted.org/packages/e5/b0/c121fd1fa3419ea9bfd55c7f9c4fedfec5143208d8c7ad3ce3db6c623c21/isort-4.3.21-py2.py3-none-any.whl
Collecting astroid<3,>=2.2.0 (from pylint)
  Using cached https://files.pythonhosted.org/packages/d5/ad/7221a62a2dbce5c3b8c57fd18e1052c7331adc19b3f27f1561aa6e620db2/astroid-2.2.5-py3-none-any.whl
Collecting mccabe<0.7,>=0.6 (from pylint)
  Using cached https://files.pythonhosted.org/packages/87/89/479dc97e18549e21354893e4ee4ef36db1d237534982482c3681ee6e7b57/mccabe-0.6.1-py2.py3-none-any.whl
Collecting typed-ast>=1.3.0; implementation_name == "cpython" (from astroid<3,>=2.2.0->pylint)
  Using cached https://files.pythonhosted.org/packages/c1/1f/33ea7a3fecec1878e7697ca6bb0e624970f8c3cd8b8932ff6ed74b10858b/typed_ast-1.4.0-cp35-cp35m-win_amd64.whl
Collecting lazy-object-proxy (from astroid<3,>=2.2.0->pylint)
  Using cached https://files.pythonhosted.org/packages/5d/e5/0898a1c288ecad4650dbd68f1fac1dda6ab4c8f70e437a8f08add75e1650/lazy_object_proxy-1.4.2-cp35-cp35m-win_amd64.whl
Collecting wrapt (from astroid<3,>=2.2.0->pylint)
Requirement already satisfied, skipping upgrade: six in c:\program files (x86)\microsoft visual studio\shared\anaconda3_64\envs\derm-ai\lib\site-packages (from astroid<3,>=2.2.0->pylint) (1.12.0)
Installing collected packages: colorama, isort, typed-ast, lazy-object-proxy, wrapt, astroid, mccabe, pylint
ERROR: Could not install packages due to an EnvironmentError: [WinError 5] Access is denied: 'C:\\Program Files (x86)\\Microsoft Visual Studio\\Shared\\Anaconda3_64\\envs\\derm-ai\\Lib\\site-packages\\colorama'
Consider using the `--user` option or check the permissions.

Хотя pylint можно установить из приглашения Anaconda, запущенного от имени администратора, я считаю, что он должен работать из VSCode напрямую, если они предоставляют эту функцию.Или я должен запускать VS Code от имени администратора?

1 Ответ

0 голосов
/ 23 сентября 2019

VSCode не может найти pylint.exe.

Вы должны указать VSCode абсолютный путь к pylint.exe.Добавьте следующее содержимое в settings.json

    // Path to Pylint, you can use a custom version of pylint by modifying this setting to include the full path.
    "python.linting.pylintPath": "absolute to pylint.exe,

Примечание : Escape \ как \\ в значении пути.

...