1

I am now using Python to download files from Dropbox, and I following this tutorial. However, it did not succeed on the first two lines of codes:

import dropbox
dbx = dropbox.Dropbox('YOUR_ACCESS_TOKEN')

My Python complains that AttributeError: 'module' object has no attribute 'Dropbox' Any ideas?

4
  • 1
    did you name your file "dropbox.py"? Commented Sep 30, 2016 at 14:18
  • Ttry doing this: print(dropbox.__file__) after the import statement. That's two underscores on either side of file. It will tell you what file is being imported. Most likely, the file you're importing is not the actual dropbox module, but something else. Commented Sep 30, 2016 at 14:25
  • @BryanOakley Thanks, but it is not the case. The print output is: C:\Anaconda2\lib\site-packages\dropbox-2.2.0-py2.7.egg\dropbox_init_.pyc Commented Sep 30, 2016 at 14:35
  • This weird as it is a common case, in case we have a .py in the dir with same name as of the module we import i.e. wrong module get imported - check the site-packages dir if you have more than dropbox folders there Commented Sep 30, 2016 at 14:59

1 Answer 1

1

After careful examination, I found the reason is because I am using functions from dropbox-v2 while in my machine dropbox-v1 was installed.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.