Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Error when running dropbox.py

Tags:

python

dropbox

test@SERVER:~/source/dropbox/.dropbox-dist$ ./dropbox.py      
Traceback (most recent call last):
  File "./dropbox.py", line 39, in <module>
    import urllib
  File "/usr/lib/python2.6/urllib.py", line 30, in <module>
    from urlparse import urljoin as basejoin
  File "/usr/lib/python2.6/urlparse.py", line 84, in <module>
    from collections import namedtuple
ImportError: cannot import name namedtuple

dropbox.py has 755 perms. In system I have 2, 2.6 versions of python. Running python2 dropbox.py or python2.6 dropbox.py spits the same error.

and here is dropbox.py file from Dropbox website

Update per comment:

test@SERVER:~/source/dropbox/.dropbox-dist$ python2.6
Python 2.6.5 (r265:79063, Apr 16 2010, 13:57:41) 
[GCC 4.4.3] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> from collections import namedtuple
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
ImportError: cannot import name namedtuple
>>> 
like image 727
Pablo Avatar asked Jul 06 '26 22:07

Pablo


1 Answers

Looks like there's another module in your Python path named collections (probably collections.py but could also be a folder named collections that has an __init__.py in it) that's preventing the Python 2.6 collections module from being imported. Could be something in the directory that's current when you invoke Python -- check there first. Otherwise try python26 -c 'import sys; print sys.path' to see where Python's looking for modules.

like image 141
kindall Avatar answered Jul 08 '26 11:07

kindall