VScodeで以下のエラーが表示されました。ただ実行には何も影響がないみたいです。
import requests
<class 'RuntimeError'>: generator raised StopIterationpylint(F0002)
というわけで対処法
環境
python --version
Python 3.7.0
原因
以下でissueがあるようにpylintのバージョンの問題らしい。
https://github.com/Microsoft/vscode-python/issues/2229
対処
pipでupgradeする。
pip install pylint --upgrade
Collecting pylint
Downloading https://files.pythonhosted.org/packages/a5/06/ecef826f319055e6b231716730d7f9047dd7524ffda224b521d989f085b6/pylint-2.2.2-py3-none-any.whl (750kB)
100% |████████████████████████████████| 757kB 10.0MB/s
Collecting astroid>=2.0.0 (from pylint)
Downloading https://files.pythonhosted.org/packages/fc/53/8809bc008bad0300897281a7b320b286dc0e84e836396c0cff6279841e8a/astroid-2.1.0-py3-none-any.whl (176kB)
100% |████████████████████████████████| 184kB 11.4MB/s
Requirement already satisfied, skipping upgrade: isort>=4.2.5 in /anaconda3/lib/python3.7/site-packages (from pylint) (4.3.4)
Requirement already satisfied, skipping upgrade: mccabe in /anaconda3/lib/python3.7/site-packages (from pylint) (0.6.1)
Requirement already satisfied, skipping upgrade: six in /anaconda3/lib/python3.7/site-packages (from astroid>=2.0.0->pylint) (1.11.0)
Requirement already satisfied, skipping upgrade: wrapt in /anaconda3/lib/python3.7/site-packages (from astroid>=2.0.0->pylint) (1.10.11)
Requirement already satisfied, skipping upgrade: lazy-object-proxy in /anaconda3/lib/python3.7/site-packages (from astroid>=2.0.0->pylint) (1.3.1)
Installing collected packages: astroid, pylint
Found existing installation: astroid 1.6.5
Uninstalling astroid-1.6.5:
Successfully uninstalled astroid-1.6.5
Found existing installation: pylint 1.9.3
Uninstalling pylint-1.9.3:
Successfully uninstalled pylint-1.9.3
Successfully installed astroid-2.1.0 pylint-2.2.2
簡単に消えました。
コメント