Skip to content

Fails to install on Python 3.9 on Windows #9488

Description

@BrianMSheldon

Bug Report

MyPy fails to install on Python 3.9.

To Reproduce

(Write your steps here:)

  1. Install Python 3.9
  2. pip install mypy
  3. Observe error installing

Expected Behavior

Package installs normally as on previous python versions.

Actual Behavior

An exception occurs when installing due to typed-ast dependency which explicitly does not support Python 3.9 (see readme). Example output below:

Collecting mypy
Using cached mypy-0.782-py3-none-any.whl (2.4 MB)
Collecting typed-ast<1.5.0,>=1.4.0
Using cached typed_ast-1.4.1.tar.gz (208 kB)
Requirement already satisfied: typing-extensions>=3.7.4 in y:\git\game\venv\lib\site-packages (from mypy) (3.7.4.3)
Requirement already satisfied: mypy-extensions<0.5.0,>=0.4.3 in y:\git\game\venv\lib\site-packages (from mypy) (0.4.3)
Using legacy 'setup.py install' for typed-ast, since package 'wheel' is not installed.
Installing collected packages: typed-ast, mypy
Running setup.py install for typed-ast ... error
ERROR: Command errored out with exit status 1:
command: 'y:\git\game\venv\scripts\python.exe' -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'C:\\Users\\tech\\AppData\\Local\\Temp\\pip-install-xo
mc8b46\\typed-ast\\setup.py'"'"'; __file__='"'"'C:\\Users\\tech\\AppData\\Local\\Temp\\pip-install-xomc8b46\\typed-ast\\setup.py'"'"';f=getattr(tokenize, '"'"'open'"
'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' install --record 'C:\Users\tech\App
Data\Local\Temp\pip-record-26ilfbh2\install-record.txt' --single-version-externally-managed --compile --install-headers 'y:\git\game\venv\include\site\python3.9\type
d-ast'
cwd: C:\Users\tech\AppData\Local\Temp\pip-install-xomc8b46\typed-ast\
Complete output (25 lines):
running install
running build
running build_py
creating build
creating build\lib.win-amd64-3.9
creating build\lib.win-amd64-3.9\typed_ast
copying typed_ast\ast27.py -> build\lib.win-amd64-3.9\typed_ast
copying typed_ast\ast3.py -> build\lib.win-amd64-3.9\typed_ast
copying typed_ast\conversions.py -> build\lib.win-amd64-3.9\typed_ast
copying typed_ast\__init__.py -> build\lib.win-amd64-3.9\typed_ast
package init file 'ast3\tests\__init__.py' not found (or not a regular file)
creating build\lib.win-amd64-3.9\typed_ast\tests
copying ast3\tests\test_basics.py -> build\lib.win-amd64-3.9\typed_ast\tests
running build_ext
building '_ast27' extension
creating build\temp.win-amd64-3.9
creating build\temp.win-amd64-3.9\Release
creating build\temp.win-amd64-3.9\Release\ast27
creating build\temp.win-amd64-3.9\Release\ast27\Custom
creating build\temp.win-amd64-3.9\Release\ast27\Parser
creating build\temp.win-amd64-3.9\Release\ast27\Python
C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.24.28314\bin\HostX86\x64\cl.exe /c /nologo /Ox /W3 /GL /DNDEBUG /MD -Iast27/Includ
e -Iy:\git\game\venv\include -IC:\Python\3.9\include -IC:\Python\3.9\include -IC:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.24.2831
4\include /Tcast27/Custom/typed_ast.c /Fobuild\temp.win-amd64-3.9\Release\ast27/Custom/typed_ast.obj
typed_ast.c
C:\Python\3.9\include\pyconfig.h(59): fatal error C1083: Cannot open include file: 'io.h': No such file or directory
error: command 'C:\\Program Files (x86)\\Microsoft Visual Studio\\2019\\Community\\VC\\Tools\\MSVC\\14.24.28314\\bin\\HostX86\\x64\\cl.exe' failed with exit code
2
----------------------------------------
ERROR: Command errored out with exit status 1: 'y:\git\game\venv\scripts\python.exe' -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'C:\\Users\\tech\\App
Data\\Local\\Temp\\pip-install-xomc8b46\\typed-ast\\setup.py'"'"'; __file__='"'"'C:\\Users\\tech\\AppData\\Local\\Temp\\pip-install-xomc8b46\\typed-ast\\setup.py'"'"
';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' in
stall --record 'C:\Users\tech\AppData\Local\Temp\pip-record-26ilfbh2\install-record.txt' --single-version-externally-managed --compile --install-headers 'y:\git\game
\venv\include\site\python3.9\typed-ast' Check the logs for full command output.

Your Environment

  • Mypy version used: N/A
  • Mypy command-line flags: N/A
  • Mypy configuration options from mypy.ini (and other config files): N/A
  • Python version used: 3.9.0rc2
  • Operating system and version:
    Win 10 Pro
    Version 1909 (OS Build 18363.1016)
  • pip: 20.2.1
  • setuptools: 49.2.1

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions