Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

245
Views
AttributeError: el módulo 'importlib' no tiene atributo 'util'

Acabo de actualizar Fedora 32 a Fedora 33 (que viene con Python 3.9). Desde entonces, el comando gcloud dejó de funcionar:

 [guy@Gandalf32 ~]$ gcloud Error processing line 3 of /home/guy/.local/lib/python3.9/site-packages/XStatic-1.0.2-py3.9-nspkg.pth: Traceback (most recent call last): File "/usr/lib64/python3.9/site.py", line 169, in addpackage exec(line) File "<string>", line 1, in <module> File "<frozen importlib._bootstrap>", line 562, in module_from_spec AttributeError: 'NoneType' object has no attribute 'loader' Remainder of file ignored Traceback (most recent call last): File "/usr/lib64/google-cloud-sdk/lib/gcloud.py", line 104, in <module> main() File "/usr/lib64/google-cloud-sdk/lib/gcloud.py", line 62, in main from googlecloudsdk.core.util import encoding File "/usr/lib64/google-cloud-sdk/lib/googlecloudsdk/__init__.py", line 23, in <module> from googlecloudsdk.core.util import importing File "/usr/lib64/google-cloud-sdk/lib/googlecloudsdk/core/util/importing.py", line 23, in <module> import imp File "/usr/lib64/python3.9/imp.py", line 23, in <module> from importlib import util File "/usr/lib64/python3.9/importlib/util.py", line 2, in <module> from . import abc File "/usr/lib64/python3.9/importlib/abc.py", line 17, in <module> from typing import Protocol, runtime_checkable File "/usr/lib64/python3.9/typing.py", line 26, in <module> import re as stdlib_re # Avoid confusion with the re we export. File "/usr/lib64/python3.9/re.py", line 124, in <module> import enum File "/usr/lib64/google-cloud-sdk/lib/third_party/enum/__init__.py", line 26, in <module> spec = importlib.util.find_spec('enum') AttributeError: module 'importlib' has no attribute 'util'
over 4 years ago · Hanz Gallego
6 answers
Answer question

0

Actualizar desde el soporte de GCP

El soporte de GCP mencionó que la nueva versión 318.0.0 lanzada el 2020.11.10 debería ser compatible con Python 3.9

Actualicé mi SDK de gcloud a 318.0.0 y ahora parece que Python 3.9.0 es compatible.

Para solucionar este problema, ejecute

gcloud components update

Fedora 33 incluye python 2.7 y para obligar a GCloud SDK a usarlo, configure esta variable de entorno

 export CLOUDSDK_PYTHON=python2

Puede agregar este comando de exportación a su ~/.bash_profile

Python 3.9 es muy nuevo y se espera que Gcloud SDK no sea compatible con 3.9, está escrito para ser compatible con 2.7.x y 3.6 - 3.8 (3.8 puede causar algunos problemas de compatibilidad, recomiendo usar 3.7)

Como solución, configure Python 3.8 o 3.7 (estas versiones funcionan bien para Gcloud y la mayoría de las distribuciones de Linux) como intérprete de todo el sistema e intente usar los comandos de gcloud.

over 4 years ago · Hanz Gallego Report

0

Si no desea usar Python 2, puede usar Python 3.8 en Fedora 33 hasta que el SDK comience a admitir Python 3.9.

Instale python 3.8 usando:

 sudo dnf install python3.8

Puede verificar su instalación ejecutando:

 python3.8 --version

Luego configúralo como el intérprete del SDK de Google Cloud:

 export CLOUDSDK_PYTHON=python3.8

Después de esto, el SDK debería funcionar normalmente.

over 4 years ago · Hanz Gallego Report

0

gcloud se actualizará a la versión 318 el 10 de noviembre y solucionará este problema.

over 4 years ago · Hanz Gallego Report

0

Para macOS/Homebrew:

 brew install python@3.8 export CLOUDSDK_PYTHON=python3.8 ln -s /usr/local/Cellar/python@3.8/*/bin/python3.8 /usr/local/bin/python3.8 gcloud components update # the issue is now resolved and you can return to python 3.9 unset CLOUDSDK_PYTHON
over 4 years ago · Hanz Gallego Report

0

Me pasó después de una actualización de cerveza. Funciona con Python 3.8.

Necesita hacer python3.8 en su ruta de shell. Ejecuté las siguientes líneas y funcionó.

 export PATH="/usr/local/opt/python@3.8/bin:$PATH" alias python=/usr/local/opt/python@3.8/bin/python3

¡Gracias!

over 4 years ago · Hanz Gallego Report

0

Para usuarios de Mac OS

En primer lugar, debe ejecutar brew update .

Si tienes este error:

 Error: homebrew-core is a shallow clone. To `brew update` first run: git -C "/usr/local/Homebrew/Library/Taps/homebrew/homebrew-core" fetch --unshallow This restriction has been made on GitHub's request because updating shallow clones is an extremely expensive operation due to the tree layout and traffic of Homebrew/homebrew-core. We don't do this for you automatically to avoid repeatedly performing an expensive unshallow operation in CI systems (which should instead be fixed to not use shallow clones). Sorry for the inconvenience!

Ejecute los siguientes comandos:

 git -C "/usr/local/Homebrew/Library/Taps/homebrew/homebrew-core" fetch --unshallow git -C "/usr/local/Homebrew/Library/Taps/homebrew/homebrew-cask" fetch --unshallow

Ahora,

Actualizar python 3.8 brew upgrade python@3.8

Agregue python 3.8 a PATH export PATH="/usr/local/opt/python@3.8/bin:$PATH"

Usar python 3.8 en la export CLOUDSDK_PYTHON=python3.8

Ahora, puede actualizar los componentes gcloud components update

over 4 years ago · Hanz Gallego Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!