Importador de Python 3: no se puede importar el nombre 'Config' al importar boto3 después de instalar con pip3

0

Actualmente estoy intentando configurar Python3 correctamente con boto3 para utilizar el SDK Python de AWS Dynamo. He usado HomeBrew para instalar Python3 y luego he instalado pip y pip3 para mis versiones de python 2 y python 3 respectivamente.

También he instalado boto y boto3 para Python2 y Python3.

workspace: python -c "import boto"
workspace: python -c "import boto3"
workspace: python3 -c "import boto"
workspace: python3 -c "import boto3"
Traceback (most recent call last):
  File "<string>", line 1, in <module>
  File "/usr/local/lib/python3.6/site-packages/boto3/__init__.py", line 16, in <module>
    from boto3.session import Session
  File "/usr/local/lib/python3.6/site-packages/boto3/session.py", line 18, in <module>
    from botocore.client import Config
ImportError: cannot import name 'Config'

Pero es Python 3 lo que me está dando el problema como se puede ver arriba. Aquí está mi configuración completa:

workspace: which python
/usr/bin/python
workspace: which python3
/usr/local/bin/python3

workspace: brew list --versions python3
python3 3.6.0_1

workspace: sudo pip install boto; sudo pip install boto3;
Requirement already satisfied: boto in /Library/Python/2.7/site-packages
Requirement already satisfied: boto3 in /Library/Python/2.7/site-packages
Requirement already satisfied: jmespath<1.0.0,>=0.7.1 in /Library/Python/2.7/site-packages (from boto3)
Requirement already satisfied: s3transfer<0.2.0,>=0.1.10 in /Library/Python/2.7/site-packages (from boto3)
Requirement already satisfied: botocore<1.6.0,>=1.5.0 in /Library/Python/2.7/site-packages (from boto3)
Requirement already satisfied: futures<4.0.0,>=2.2.0; python_version == "2.6" or python_version == "2.7" in /    Library/Python/2.7/site-packages (from s3transfer<0.2.0,>=0.1.10->boto3)
Requirement already satisfied: docutils>=0.10 in /Library/Python/2.7/site-packages (from botocore<1.6.0,>=1.5.0-    >boto3)
Requirement already satisfied: python-dateutil<3.0.0,>=2.1 in /Library/Python/2.7/site-packages (from     botocore<1.6.0,>=1.5.0->boto3)
Requirement already satisfied: six>=1.5 in /Library/Python/2.7/site-packages (from python-dateutil<3.0.0,>=2.1->    botocore<1.6.0,>=1.5.0->boto3)    

workspace: pip3 install boto; pip3 install boto3;
Requirement already satisfied: boto in /usr/local/lib/python3.6/site-packages
Requirement already satisfied: boto3 in /usr/local/lib/python3.6/site-packages
Requirement already satisfied: botocore<1.6.0,>=1.5.0 in /usr/local/lib/python3.6/site-packages (from boto3)
Requirement already satisfied: jmespath<1.0.0,>=0.7.1 in /usr/local/lib/python3.6/site-packages (from boto3)
Requirement already satisfied: s3transfer<0.2.0,>=0.1.10 in /usr/local/lib/python3.6/site-packages (from boto3)
Requirement already satisfied: docutils>=0.10 in /usr/local/lib/python3.6/site-packages (from botocore<1.6.0,>=1.5.0->boto3)
Requirement already satisfied: python-dateutil<3.0.0,>=2.1 in /usr/local/lib/python3.6/site-packages (from botocore<1.6.0,>=1.5.0->boto3)
Requirement already satisfied: six>=1.5 in /usr/local/lib/python3.6/site-packages (from python-dateutil<3.0.0,>=2.1->botocore<1.6.0,>=1.5.0->boto3)

Lo frustrante es que boto3 funciona totalmente bien en Python 2.7.10 que venía con mi instalación de macOS. Pero me gustaría usar Python 3 y parece que no puedo continuar con él.

    
pregunta anon58192932 22.03.2017 - 23:24

1 respuesta

1

Funcionará si instala Python 3.5 específicamente, no estoy seguro de si lo han actualizado a 3.6 aún, pero recientemente fue incompatible con él.

    
respondido por el Andrew Rowlands 12.05.2017 - 09:34

Lea otras preguntas en las etiquetas