Python 3 ImportError: impossibile importare il nome 'Config' durante l'importazione di boto3 dopo l'installazione con pip3

0

Attualmente prova a configurare correttamente Python3 con boto3 per utilizzare l'SDK Dynamo Python di AWS. Ho usato HomeBrew per installare Python3 e poi ho installato pip e pip3 rispettivamente per le mie versioni python 2 e python 3.

Ho anche installato boto e boto3 sia per Python2 che per 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'

Ma è Python 3 a darmi il problema, come puoi vedere sopra. Ecco la mia configurazione 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)

La cosa frustrante è che boto3 funziona perfettamente con Python 2.7.10 fornito con la mia installazione macOS. Ma mi piacerebbe usare Python 3 e non riesco a continuare con esso.

    
posta anon58192932 22.03.2017 - 23:24
fonte

1 risposta

1

Funzionerà se installerai Python 3.5 in modo specifico, non so se lo hanno ancora aggiornato per 3.6, ma di recente è incompatibile con esso.

    
risposta data 12.05.2017 - 09:34
fonte

Leggi altre domande sui tag