Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

AttributeError: 'module' object has no attribute 'client' python dropbox api [closed]

Tags:

python

dropbox

I'm starting with the python api dropbox ,I've copied the first example but I get an error

import dropbox

# Get your app key and secret from the Dropbox developer website
app_key = 'MY_APP_KEY'
app_secret = 'MY_APP_SECRET'

flow = dropbox.client.DropboxOAuth2FlowNoRedirect(app_key, app_secret)

the dropbox object has not a client atribute but it's the same code of the documentation.

the traceback

/usr/bin/python2.7 /home/user/PycharmProjects/api/dropbox.py
Traceback (most recent call last):
  File "/home/user/PycharmProjects/api/dropbox.py", line 3, in <module>
    import dropbox
  File "/home/user/PycharmProjects/api/dropbox.py", line 9, in <module>
    flow = dropbox.client.DropboxOAuth2FlowNoRedirect(app_key, app_secret)
AttributeError: 'module' object has no attribute 'client'
like image 952
AFS Avatar asked Dec 08 '22 03:12

AFS


1 Answers

You have called your own script dropbox.py, you need to rename your script and delete any dropbox.pyc file. You are trying to import from your local file not the dropbox module.

like image 96
Padraic Cunningham Avatar answered Dec 14 '22 23:12

Padraic Cunningham