0

Hello and excuse me for my English.

I have problems with importing dropbox.egg in my django project, I am using Eclipse as IDE on Windows 7. I installed dropbox.egg with easy_install on my c:\Python27. In System libraries of my project I've the dropbox.egg as like this:

'C:\Python27\lib\site-packages\dropbox-1.5.1-py2.7.egg'

I have also tried to import dropbox.egg as external libs but I didn't have success.

My sys.path produced this output:

['C:\\Users\\Blackat\\Documents\\workspace\\Gestionale', 
'C:\\Python27\\lib\\site-    packages\\oauth-1.0.1-py2.7.egg', 
'C:\\Python27\\lib\\site-packages\\dropbox-1.5.1-py2.7.egg', 
'C:\\Users\\Blackat\\Documents\\workspace\\Gestionale', 'C:\\Python27', 
'C:\\Python27\\DLLs', 'C:\\Python27\\lib', 'C:\\Python27\\lib\\plat-win', 
'C:\\Python27\\lib\\lib-tk', 'C:\\Python27\\lib\\site-packages', 
'C:\\Python27\\lib\\site-packages\\win32', 'C:\\Python27\\lib\\site-
packages\\win32\\lib', 'C:\\Python27\\lib\\site-packages\\Pythonwin', 
'C:\\Windows\\system32\\python27.zip', 'C:\\Python27\\lib\\site-packages\\PIL']

This is the error, which is printed in Eclipse console:

from dropbox import client,session
File "C:\Users\Blackat\Documents\workspace\Gestionale\edicola\dropbox.py", 
line 14, in <module>
ImportError: cannot import name session**

and this is the error, which is displayed on django page

cannot import name session
Request Method: GET
Request URL:    
Django Version: 1.5
Exception Type: ImportError
Exception Value:    
cannot import name session
Exception Location: C:\Users\Blackat\Documents\workspace\Gestionale\edicola\pippo.py in     
<module>, line 6
Python Executable:  C:\Python27\python.exe
Python Version: 2.7.3
Python Path:    
['C:\\Users\\Blackat\\Documents\\workspace\\Gestionale',
'C:\\Users\\Blackat\\Documents\\workspace\\Gestionale',
'C:\\Python27\\lib\\site-packages\\oauth-1.0.1-py2.7.egg',
'C:\\Python27\\lib\\site-packages\\dropbox-1.5.1-py2.7.egg',
'C:\\Python27',
'C:\\Python27\\DLLs',
'C:\\Python27\\lib',
'C:\\Python27\\lib\\plat-win',
'C:\\Python27\\lib\\lib-tk',
'C:\\Python27\\lib\\site-packages',
'C:\\Python27\\lib\\site-packages\\PIL',
'C:\\Python27\\lib\\site-packages\\win32',
'C:\\Python27\\lib\\site-packages\\win32\\lib',
'C:\\Python27\\lib\\site-packages\\Pythonwin',
'C:\\Windows\\system32\\python27.zip',
'dropbox_python_sdk-1.5.1-py2.7.egg']

Thanks for your help.

4

1 回答 1

1

Do you have a file called dropbox.py as part of your project? If so, I suspect that's what's being imported instead of the actual Dropbox package. Try renaming dropbox.py to something else.

于 2013-06-04T15:24:58.377 回答