Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

460
Visualizações
Python 3.9.8 fails using Black and importing `typed_ast.ast3`

Since updating to python@3.9.8 we get an error while using Black in our CI pipeline.

black....................................................................Failed
- hook id: black
- exit code: 1
Traceback (most recent call last):
  File "../.cache/pre-commit/repol9drvp84/py_env-python3/bin/black", line 5, in <module>
    from black import patched_main
  File "../.cache/pre-commit/repol9drvp84/py_env-python3/lib/python3.9/site-packages/black/__init__.py", line 52, in <module>
    from typed_ast import ast3, ast27
  File "../.cache/pre-commit/repol9drvp84/py_env-python3/lib/python3.9/site-packages/typed_ast/ast3.py", line 40, in <module>
    from typed_ast import _ast3
ImportError: ../.cache/pre-commit/repol9drvp84/py_env-python3/lib/python3.9/site-packages/typed_ast/_ast3.cpython-39-x86_64-linux-gnu.so: undefined symbol: _PyUnicode_DecodeUnicodeEscape

The error can be easily reproduced with:

% pip install typed_ast
% python3 -c 'from typed_ast import ast3'
Traceback (most recent call last):
  File "<string>", line 1, in <module>
ImportError: 
/usr/lib/python3/dist-packages/typed_ast/_ast3.cpython-39-x86_64-linux-gnu.so: 
undefined symbol: _PyUnicode_DecodeUnicodeEscape

Currently the only workaround is downgrading to python@3.9.7.

Is any other fix available?

See also https://www.mail-archive.com/debian-bugs-dist@lists.debian.org/msg1829077.html

over 4 years ago · Santiago Trujillo
1 Respostas
Responde à pergunta

0

The initial error was a failing python Black pipeline. Black failed because it was pinned to an older version which now fails with python3.9.8.

Updating black to the latest version 21.10b0 fixed the error for me.

See also typed_ast issue #169:

For others who may find this in a search, I ran into this problem via black because I had black pinned to an older version. The current version of black appears to no longer use typed-ast and thus won't encounter this issue.

Update:

using the latest typed-ast version >=1.5.0 seem to work as well

e.g. pip install typed-ast --upgrade

over 4 years ago · Santiago Trujillo Relatório
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda