package typed-ast older versions doesn't work on python 3.8?

See original GitHub issue

Hi, Ethan ✌ I just set PythonBuddy in my WSL installation and during the installation of the required packages an error was raised. I was able to fix it so I’m posting the step here in case anyone is interested.

Steps to reproduce the behavior:

  1. Ubuntu 20.04 on Windows Subsystem for Linux
  2. Python 3.8
  3. Clone the repo, create a virtualenv for it
  4. Try to install the required packages and get the following error:
    Running setup.py install for typed-ast ... error
    ERROR: Command errored out with exit status 1:
     command: /usr/bin/python3 -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-install-tr7ufsax/typed-ast/setup.py'"'"'; __file__='"'"'/tmp/pip-install-tr7ufsax/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-qwpgruzh/install-record.txt --single-version-externally-managed --user --prefix= --compile --install-headers /home/marcelo/.local/include/python3.8/typed-ast
         cwd: /tmp/pip-install-tr7ufsax/typed-ast/
    Complete output (23 lines):
    running install
    running build
    running build_py
    creating build
    creating build/lib.linux-x86_64-3.8
    creating build/lib.linux-x86_64-3.8/typed_ast
    copying typed_ast/__init__.py -> build/lib.linux-x86_64-3.8/typed_ast
    copying typed_ast/ast27.py -> build/lib.linux-x86_64-3.8/typed_ast
    copying typed_ast/ast3.py -> build/lib.linux-x86_64-3.8/typed_ast
    copying typed_ast/conversions.py -> build/lib.linux-x86_64-3.8/typed_ast
    running build_ext
    building '_ast27' extension
    creating build/temp.linux-x86_64-3.8
    creating build/temp.linux-x86_64-3.8/ast27
    creating build/temp.linux-x86_64-3.8/ast27/Parser
    creating build/temp.linux-x86_64-3.8/ast27/Python
    creating build/temp.linux-x86_64-3.8/ast27/Custom
    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 -fwrapv -O2 -g -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -fPIC -Iast27/Include -I/usr/include/python3.8 -c ast27/Parser/acceler.c -o build/temp.linux-x86_64-3.8/ast27/Parser/acceler.o
    ast27/Parser/acceler.c:13:10: fatal error: pgenheaders.h: No such file or directory
       13 | #include "pgenheaders.h"
          |          ^~~~~~~~~~~~~~~
    compilation terminated.
    error: command 'x86_64-linux-gnu-gcc' failed with exit status 1

Expected behavior ´´pip3 install -r should execute without errors´´

I managed to fix this by upgrading the version of the package that is being accused of raising the error. Someone at Stackoverflow had a similar issue and the solution worked for me here too. Solution:

Upgrading to typed-ast==1.4.1 worked for me using Python 3.8.5

After the solution was applied I could install the required packages without errors.

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:5 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
ethanchewycommented, Oct 28, 2020

@marceloFA lmk if pulling the most recent changes work! Thanks!

I also updated the docs to reflect the specific virtualenv version you need.

1reaction
ethanchewycommented, Oct 28, 2020

Thank you for bringing this up and providing a thorough error report, plus linking a potential solution.

This was very helpful.

I am investigating this right now.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Error installing on Windows with Python 3.8 #126 - GitHub
I encountered this problem trying to install mypy: When I try to install Typed AST in Windows 7 in a new Python 3.8...
Read more >
typed-ast - PyPI
The typed_ast parsers produce the standard Python AST (plus type comments), and are both fast and correct, as they are based on the...
Read more >
Failed building wheel for typed-ast - python - Stack Overflow
It seems to be a version issue. I manually installed typed_ast: pip3 install typed_ast. This installed version 1.4.2.
Read more >
Python tests not compatible with python 3.8 because of typed-ast
When installing the dependencies, it fails on typed-ast . See typed-ast GitHub repo. typed_ast will not be updated to support parsing Python 3.8...
Read more >
[SERVER-49352] 4.0 does not build with python 3.8
Running setup.py install for typed-ast ... error ... The issue appears to be described here: https://github.com/python/typed_ast/issues/126.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found