sendinblue / APIv3-python-library

SendinBlue's python library for API v3
MIT License
82 stars 40 forks source link

AttributeError: module 'sib_api_v3_sdk' has no attribute 'Configuration' #73

Closed Clobbe closed 3 years ago

Clobbe commented 3 years ago

Hey,

Just installed latest API lib from Github as per your instructions.

However when I'm trying to run your "Getting Started" example (see code at: https://github.com/sendinblue/APIv3-python-library#getting-started)

I get the following output:

Traceback (most recent call last):
  File "~/email.py", line 9, in <module>
    import sib_api_v3_sdk
  File "<frozen importlib._bootstrap>", line 1007, in _find_and_load
  File "<frozen importlib._bootstrap>", line 986, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 664, in _load_unlocked
  File "<frozen importlib._bootstrap>", line 627, in _load_backward_compatible
  File "<frozen zipimport>", line 259, in load_module
  File "~/.local/lib/python3.9/site-packages/sib_api_v3_sdk-7.2.0-py3.9.egg/sib_api_v3_sdk/__init__.py", line 19, in <module>
  File "<frozen importlib._bootstrap>", line 1007, in _find_and_load
  File "<frozen importlib._bootstrap>", line 986, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 664, in _load_unlocked
  File "<frozen importlib._bootstrap>", line 627, in _load_backward_compatible
  File "<frozen zipimport>", line 259, in load_module
  File "~/.local/lib/python3.9/site-packages/sib_api_v3_sdk-7.2.0-py3.9.egg/sib_api_v3_sdk/api/__init__.py", line 6, in <module>
  File "<frozen importlib._bootstrap>", line 1007, in _find_and_load
  File "<frozen importlib._bootstrap>", line 986, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 664, in _load_unlocked
  File "<frozen importlib._bootstrap>", line 627, in _load_backward_compatible
  File "<frozen zipimport>", line 259, in load_module
  File "~/.local/lib/python3.9/site-packages/sib_api_v3_sdk-7.2.0-py3.9.egg/sib_api_v3_sdk/api/account_api.py", line 21, in <module>
  File "<frozen importlib._bootstrap>", line 1007, in _find_and_load
  File "<frozen importlib._bootstrap>", line 986, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 664, in _load_unlocked
  File "<frozen importlib._bootstrap>", line 627, in _load_backward_compatible
  File "<frozen zipimport>", line 259, in load_module
  File "~/.local/lib/python3.9/site-packages/sib_api_v3_sdk-7.2.0-py3.9.egg/sib_api_v3_sdk/api_client.py", line 26, in <module>
  File "<frozen importlib._bootstrap>", line 1007, in _find_and_load
  File "<frozen importlib._bootstrap>", line 986, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 664, in _load_unlocked
  File "<frozen importlib._bootstrap>", line 627, in _load_backward_compatible
  File "<frozen zipimport>", line 259, in load_module
  File "~/.local/lib/python3.9/site-packages/sib_api_v3_sdk-7.2.0-py3.9.egg/sib_api_v3_sdk/configuration.py", line 20, in <module>
  File "~/anaconda3/envs/ea-v1/lib/python3.9/site-packages/urllib3/__init__.py", line 11, in <module>
    from . import exceptions
  File "~/anaconda3/envs/ea-v1/lib/python3.9/site-packages/urllib3/exceptions.py", line 3, in <module>
    from .packages.six.moves.http_client import IncompleteRead as httplib_IncompleteRead
  File "<frozen importlib._bootstrap>", line 1007, in _find_and_load
  File "<frozen importlib._bootstrap>", line 986, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 666, in _load_unlocked
  File "<frozen importlib._bootstrap>", line 565, in module_from_spec
  File "~/anaconda3/envs/ea-v1/lib/python3.9/site-packages/urllib3/packages/six.py", line 234, in create_module
    return self.load_module(spec.name)
  File "~/anaconda3/envs/ea-v1/lib/python3.9/site-packages/urllib3/packages/six.py", line 209, in load_module
    mod = mod._resolve()
  File "~/anaconda3/envs/ea-v1/lib/python3.9/site-packages/urllib3/packages/six.py", line 118, in _resolve
    return _import_module(self.mod)
  File "~/anaconda3/envs/ea-v1/lib/python3.9/site-packages/urllib3/packages/six.py", line 87, in _import_module
    __import__(name)
  File "~/anaconda3/envs/ea-v1/lib/python3.9/http/client.py", line 71, in <module>
    import email.parser
  File "~/Dev/EasyAddress/app/v2/server/src/email.py", line 21, in <module>
    configuration = sib_api_v3_sdk.Configuration()
AttributeError: module 'sib_api_v3_sdk' has no attribute 'Configuration'

Anyone else getting this problem?

mukul-brevo commented 3 years ago

Hi @Clobbe,

Please try again with following snippet

`import sib_api_v3_sdk from sib_api_v3_sdk.rest import ApiException

Configure API key authorization: api-key

configuration = sib_api_v3_sdk.Configuration() configuration.api_key["api-key"] = "" api_instance = sib_api_v3_sdk.AccountApi(sib_api_v3_sdk.ApiClient(configuration))

try:

Get your account information, plan and credits details

api_response = api_instance.get_account()
print(api_response)

except ApiException as e: print("Exception when calling AccountApi->get_account: %s\n" % e)`

Clobbe commented 3 years ago

Thank you @mukulsib for helping out :)