Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

The mypy server crashed 5 times in the last 3 minutes. The server will not be restarted. #9

Open
adam-grant-hendry opened this issue Mar 4, 2021 · 2 comments

Comments

@adam-grant-hendry
Copy link

I get the following error every time I start up VSCode:

The mypy server crashed 5 times in the last 3 minutes. The server will not be restarted.

I created a python 3.8 venv and started a project with poetry. I am using the default Microsoft Python language server in VSCode. I have the following setup:

settings.json

"mypy.configFile": "${workspaceFolder}\\mypi.ini",
"mypy.executable": "${workspaceFolder}\\.venv\\Scripts\\mypy.exe",
"mypy.targets": [
    ".",
    "${workspaceFolder}"
],
"python.linting.mypyEnabled": true,
"python.linting.mypyPath": "${workspaceFolder}\\.venv\\Scripts\\mypy.exe",

mypy.ini

[mypy]
python_version = 3.8
warn_return_any = True
warn_unused_configs = True

[mypy-bs4.*]
ignore_missing_imports = True

pyproject.toml

[tool.poetry]
name = "type_hinting_demo"
version = "0.1.0"
description = "A type hinting demo."
authors = ["Adam Hendry <[email protected]>"]
license = "Apache-2.0"
packages = [
    {include = "type_hinting_demo"},
    {include = "docs"},
    {include = "tests"}
]

[tool.poetry.dependencies]
python = "^3.8"
sphinx-rtd-theme = "^0.5.1"

[tool.poetry.dev-dependencies]
black = "^20.8b1"
bump2version = "^1.0.1"
pylint = "^2.7.0"
ipython = "^7.20.0"
isort = "^5.7.0"
docformatter = "^1.4"
pytest = "^6.2.2"
pytest-cov = "^2.11.1"
pytest-randomly = "^3.5.0"
pytest-bdd = "^4.0.2"
coverage = "^5.4"
bandit = "^1.7.0"
pytest-sphinx = "^0.3.1"
bs4 = "^0.0.1"
lxml = "^4.6.2"
html5lib = "^1.1"
requests = "^2.25.1"
coverage-badge = "^1.0.1"
pytest-mypy = "^0.8.0"
mypy = "^0.812"
flake8 = "^3.8.4"

[build-system]
requires = ["poetry-core>=1.0.0"]
build-backend = "poetry.core.masonry.api"

The output of the mypy extension is the following:

usage: mypy [-h] [-v] [-V] [more options; see below]
            [-m MODULE] [-p PACKAGE] [-c PROGRAM_TEXT] [files ...]
mypy: error: Missing target module, package, files, or command.
[Info  - 5:05:00 PM] Connection to server got closed. Server will restart.
usage: mypy [-h] [-v] [-V] [more options; see below]
            [-m MODULE] [-p PACKAGE] [-c PROGRAM_TEXT] [files ...]
mypy: error: Missing target module, package, files, or command.
[Info  - 5:05:01 PM] Connection to server got closed. Server will restart.
usage: mypy [-h] [-v] [-V] [more options; see below]
            [-m MODULE] [-p PACKAGE] [-c PROGRAM_TEXT] [files ...]
mypy: error: Missing target module, package, files, or command.
[Info  - 5:05:02 PM] Connection to server got closed. Server will restart.
usage: mypy [-h] [-v] [-V] [more options; see below]
            [-m MODULE] [-p PACKAGE] [-c PROGRAM_TEXT] [files ...]
mypy: error: Missing target module, package, files, or command.
[Info  - 5:05:03 PM] Connection to server got closed. Server will restart.
usage: mypy [-h] [-v] [-V] [more options; see below]
            [-m MODULE] [-p PACKAGE] [-c PROGRAM_TEXT] [files ...]
mypy: error: Missing target module, package, files, or command.
[Error - 5:05:03 PM] Connection to server got closed. Server will not be restarted.
@matangover
Copy link
Owner

Not quite sure what is causing mypy to crash. Can you try changing mypy.targets to just .? You have also ${workspaceFolder} in there, delete that.

@matangover
Copy link
Owner

Hi @adam-grant-hendry, is the issue still relevant?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants