I installed the oauth2 library, because I need to use the oauth2.clients.imap
module, but then I found that only under root directory can I import oauth2.clients.imap
. If I try to import this module under another directory, I got the error ImportError: No module named clients.imap
.
Asked
Active
Viewed 304 times
-1

Cacheing
- 3,431
- 20
- 46
- 65
-
1Is `oauth2` in your PYTHONPATH? – Gustavo Barbosa Aug 01 '13 at 21:21
-
@GustavoBarbosa: Sorry I was unaware of the existence of PYTHONPATH. I called `echo $PYTHONPATH` and it is empty. Should I add the path of the `oauth2` to `PYTHONPATH` according to http://stackoverflow.com/questions/15742779/how-can-i-edit-pythonpath-on-a-mac? – Cacheing Aug 01 '13 at 21:36
-
Yes, do this, and you should be good to go. – sdamashek Aug 01 '13 at 21:38
-
@Vacation9: I did according http://stackoverflow.com/questions/3387695/add-to-python-path-mac-os-x. But I am still not sure what the path mean here. Should it be the path of the directory of oauth2? – Cacheing Aug 01 '13 at 21:51
-
1Add the location of the compiled python module code for `oauth2` to your PYTHONPATH. – sdamashek Aug 01 '13 at 21:52
-
@Vacation9: how can I know the location of the complied python module code for `oauth2`? – Cacheing Aug 01 '13 at 21:54
1 Answers
0
Add this to your PYTHONPATH
environment variable:
/usr/lib/python2.7/dist-packages/oauth/

sdamashek
- 636
- 1
- 4
- 13