PROBLEMA

Erro de exceção do Python número mágico ruim em 'requests.packages': b'\x03\xf3

Last Published: April 16, 2024

Descrição

In some scenarios, such as calling a Data Interoperability Spatial ETL Tool from a Python script, the following error is returned:

bad magic number in 'requests.packages': b'\x03\xf3

The "magic number" comes from UNIX-type systems where the first few bytes of a file held a marker indicating the file type. Python puts a similar marker into its pyc files when it creates them. The Python interpreter ensures that this number is correct when loading the file.

Causa

Anything that damages this magic number will cause the error. This includes editing the .pyc file or trying to run a .pyc file from a different version of Python (usually later) than your interpreter.

Solução ou Solução Provisória

  1. If the issue is with your .pyc files, delete them and let the interpreter re-compile the .py files. On UNIX-type systems, that could be something as simple as:
rm *.pyc

or:

find . -name '*.pyc' -delet
  1. Uninstall the Data Interoperability extension.
  2. Reinstall the correct version of Python.
  3. Reinstall Data Interoperability.

ID do Artigo:000025627

Receba notificações e encontre soluções para problemas novos ou comuns

Obtenha respostas resumidas e soluções de vídeo do nosso novo chatbot de IA.

Baixe o Aplicativo de Suporte da Esri

Descubra mais sobre este tema

Obtenha ajuda de especialistas do ArcGIS

Entre em contato com Suporte Técnico

Baixe o Aplicativo de Suporte da Esri

Ir para as opções de download