-
-
Notifications
You must be signed in to change notification settings - Fork 54
Error installing on Python 3.9 #146
Comments
I think the fix will be separate though, so it's useful to track this separately. Also, while no effort will be made to support parsing Python 3.8+ using typed_ast, we may want to support parsing Python 2.7 for mypy for quite a while longer, and (once 3.9 is really out :-) it would be a bit annoying (though not truly prohibitive) to have to install an earlier version of Python for that. If #147 works I may be able to fix this by building wheels for 3.9. |
@gvanrossum Just to clarify, #147 will add wheels only for windows? As I see on pypi But I'm not sure what to do with a release process of typed-ast, looks like it'll require two releases (one for manylinux, and one for win) and it will be easier to just little wait. So, It would be great if typed-ast publish linux wheels, but I understand with respect if you decide to do it in one batch. |
Have any problem with install black: psf/black#1744 on latest Windows 10 64-bit. Microsoft Visual C++ 14.0 Build installed. Use PyCharm 2020.2 with Python 3.9 from chocolatey: https://chocolatey.org/packages/python3/3.9.0
(python39) D:\user\Dev\git\project>python --version pip install --upgrade setuptools pip wheel |
pip install --only-binary=:all: typed-ast |
Had the same error, solved it by running Error logWSL-Ubuntu:❯ /bin/python3.9 /home/df/.vscode-server/extensions/ms-python.python-2020.8.109390/pythonFiles/pyvsc-run-isolated.py pip install -U mypy --user
Collecting mypy
Using cached mypy-0.790-py3-none-any.whl (2.4 MB)
Requirement already satisfied, skipping upgrade: typing-extensions>=3.7.4 in /home/df/.local/lib/python3.9/site-packages (from mypy) (3.7.4.3)
Collecting typed-ast<1.5.0,>=1.4.0
Using cached typed_ast-1.4.1.tar.gz (208 kB)
Requirement already satisfied, skipping upgrade: mypy-extensions<0.5.0,>=0.4.3 in /home/df/.local/lib/python3.9/site-packages (from mypy) (0.4.3)
Building wheels for collected packages: typed-ast
Building wheel for typed-ast (setup.py) ... error
ERROR: Command errored out with exit status 1:
command: /bin/python3.9 -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-install-tnfc0fcn/typed-ast/setup.py'"'"'; __file__='"'"'/tmp/pip-install-tnfc0fcn/typed-ast/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' bdist_wheel -d /tmp/pip-wheel-i7q_8xvj
cwd: /tmp/pip-install-tnfc0fcn/typed-ast/
Complete output (26 lines):
running bdist_wheel
running build
running build_py
creating build
creating build/lib.linux-x86_64-3.9
creating build/lib.linux-x86_64-3.9/typed_ast
copying typed_ast/ast27.py -> build/lib.linux-x86_64-3.9/typed_ast
copying typed_ast/ast3.py -> build/lib.linux-x86_64-3.9/typed_ast
copying typed_ast/conversions.py -> build/lib.linux-x86_64-3.9/typed_ast
copying typed_ast/__init__.py -> build/lib.linux-x86_64-3.9/typed_ast
package init file 'ast3/tests/__init__.py' not found (or not a regular file)
creating build/lib.linux-x86_64-3.9/typed_ast/tests
copying ast3/tests/test_basics.py -> build/lib.linux-x86_64-3.9/typed_ast/tests
running build_ext
building '_ast27' extension
creating build/temp.linux-x86_64-3.9
creating build/temp.linux-x86_64-3.9/ast27
creating build/temp.linux-x86_64-3.9/ast27/Custom
creating build/temp.linux-x86_64-3.9/ast27/Parser
creating build/temp.linux-x86_64-3.9/ast27/Python
x86_64-linux-gnu-gcc -pthread -Wno-unused-result -Wsign-compare -DNDEBUG -g -fwrapv -O2 -Wall -g -fstack-protector-strong -Wformat -Werror=format-security -g -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -fPIC -Iast27/Include -I/usr/include/python3.9 -c ast27/Custom/typed_ast.c -o build/temp.linux-x86_64-3.9/ast27/Custom/typed_ast.o
ast27/Custom/typed_ast.c:1:10: fatal error: Python.h: No such file or directory
1 | #include "Python.h"
| ^~~~~~~~~~
compilation terminated.
error: command '/usr/bin/x86_64-linux-gnu-gcc' failed with exit code 1
----------------------------------------
ERROR: Failed building wheel for typed-ast
Running setup.py clean for typed-ast
Failed to build typed-ast
Installing collected packages: typed-ast, mypy
Running setup.py install for typed-ast ... error
ERROR: Command errored out with exit status 1:
command: /bin/python3.9 -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-install-tnfc0fcn/typed-ast/setup.py'"'"'; __file__='"'"'/tmp/pip-install-tnfc0fcn/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 /tmp/pip-record-t5rofrlv/install-record.txt --single-version-externally-managed --user --prefix= --compile --install-headers /home/df/.local/include/python3.9/typed-ast
cwd: /tmp/pip-install-tnfc0fcn/typed-ast/
Complete output (26 lines):
running install
running build
running build_py
creating build
creating build/lib.linux-x86_64-3.9
creating build/lib.linux-x86_64-3.9/typed_ast
copying typed_ast/ast27.py -> build/lib.linux-x86_64-3.9/typed_ast
copying typed_ast/ast3.py -> build/lib.linux-x86_64-3.9/typed_ast
copying typed_ast/conversions.py -> build/lib.linux-x86_64-3.9/typed_ast
copying typed_ast/__init__.py -> build/lib.linux-x86_64-3.9/typed_ast
package init file 'ast3/tests/__init__.py' not found (or not a regular file)
creating build/lib.linux-x86_64-3.9/typed_ast/tests
copying ast3/tests/test_basics.py -> build/lib.linux-x86_64-3.9/typed_ast/tests
running build_ext
building '_ast27' extension
creating build/temp.linux-x86_64-3.9
creating build/temp.linux-x86_64-3.9/ast27
creating build/temp.linux-x86_64-3.9/ast27/Custom
creating build/temp.linux-x86_64-3.9/ast27/Parser
creating build/temp.linux-x86_64-3.9/ast27/Python
x86_64-linux-gnu-gcc -pthread -Wno-unused-result -Wsign-compare -DNDEBUG -g -fwrapv -O2 -Wall -g -fstack-protector-strong -Wformat -Werror=format-security -g -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -fPIC -Iast27/Include -I/usr/include/python3.9 -c ast27/Custom/typed_ast.c -o build/temp.linux-x86_64-3.9/ast27/Custom/typed_ast.o
ast27/Custom/typed_ast.c:1:10: fatal error: Python.h: No such file or directory
1 | #include "Python.h"
| ^~~~~~~~~~
compilation terminated.
error: command '/usr/bin/x86_64-linux-gnu-gcc' failed with exit code 1
----------------------------------------
ERROR: Command errored out with exit status 1: /bin/python3.9 -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-install-tnfc0fcn/typed-ast/setup.py'"'"'; __file__='"'"'/tmp/pip-install-tnfc0fcn/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 /tmp/pip-record-t5rofrlv/install-record.txt --single-version-externally-managed --user --prefix= --compile --install-headers /home/df/.local/include/python3.9/typed-ast Check the logs for full command output.
❯ sudo apt install python3.9-dev
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following additional packages will be installed:
libpython3.9 libpython3.9-dev
The following NEW packages will be installed:
libpython3.9 libpython3.9-dev python3.9-dev
0 upgraded, 3 newly installed, 0 to remove and 3 not upgraded.
Need to get 6740 kB of archives.
After this operation, 27.9 MB of additional disk space will be used.
Do you want to continue? [Y/n] y
Get:1 http://ppa.launchpad.net/deadsnakes/ppa/ubuntu focal/main amd64 libpython3.9 amd64 3.9.0-1+focal4 [1872 kB]
Get:2 http://ppa.launchpad.net/deadsnakes/ppa/ubuntu focal/main amd64 libpython3.9-dev amd64 3.9.0-1+focal4 [4368 kB]
Get:3 http://ppa.launchpad.net/deadsnakes/ppa/ubuntu focal/main amd64 python3.9-dev amd64 3.9.0-1+focal4 [501 kB]
Fetched 6740 kB in 1s (4546 kB/s)
Selecting previously unselected package libpython3.9:amd64.
(Reading database ... 67225 files and directories currently installed.)
Preparing to unpack .../libpython3.9_3.9.0-1+focal4_amd64.deb ...
Unpacking libpython3.9:amd64 (3.9.0-1+focal4) ...
Selecting previously unselected package libpython3.9-dev:amd64.
Preparing to unpack .../libpython3.9-dev_3.9.0-1+focal4_amd64.deb ...
Unpacking libpython3.9-dev:amd64 (3.9.0-1+focal4) ...
Selecting previously unselected package python3.9-dev.
Preparing to unpack .../python3.9-dev_3.9.0-1+focal4_amd64.deb ...
Unpacking python3.9-dev (3.9.0-1+focal4) ...
Setting up libpython3.9:amd64 (3.9.0-1+focal4) ...
Setting up libpython3.9-dev:amd64 (3.9.0-1+focal4) ...
Setting up python3.9-dev (3.9.0-1+focal4) ...
Processing triggers for man-db (2.9.1-1) ...
Processing triggers for libc-bin (2.31-0ubuntu9.1) ...
❯ /bin/python3.9 /home/df/.vscode-server/extensions/ms-python.python-2020.8.109390/pythonFiles/pyvsc-run-isolated.py pip install -U mypy --user
Collecting mypy
Using cached mypy-0.790-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, skipping upgrade: mypy-extensions<0.5.0,>=0.4.3 in /home/df/.local/lib/python3.9/site-packages (from mypy) (0.4.3)
Requirement already satisfied, skipping upgrade: typing-extensions>=3.7.4 in /home/df/.local/lib/python3.9/site-packages (from mypy) (3.7.4.3)
Building wheels for collected packages: typed-ast
Building wheel for typed-ast (setup.py) ... done
Created wheel for typed-ast: filename=typed_ast-1.4.1-cp39-cp39-linux_x86_64.whl size=779552 sha256=c198aa58c863dcf4e5260a77105c8623a36b184d602f6e98729033cda75e5fb6
Stored in directory: /home/df/.cache/pip/wheels/76/9d/0a/92a418f064e7c1baabbdc49a4168b9ae8bda647cf06edab936
Successfully built typed-ast
Installing collected packages: typed-ast, mypy
Successfully installed mypy-0.790 typed-ast-1.4.1 |
#147 is green now, so windows users can download prebuilt |
|
1.4 is old. Please use the latest version. |
I do have the same error as @th-520 on a MAC M1... I can't really upgrade atm for dependencies reason. |
You'll have to find a way to upgrade. If you're using an old version of mypy that requires typed_ast<1.5, you should be able to just use the latest version of typed-ast and ignore the dependency mismatch. I don't think typed-ast has made any incompatible changes. |
thank you |
Pretty sure this is the same issue as #126
but its really annoying that this occurs for every new python release, especially since the first 3.9 testing release has been out for almost a year and final is supposed to be out in a week.. Sorry didn't see readme explicitly states that python 3.8+ are not supported.The text was updated successfully, but these errors were encountered: