Skip to content

Instantly share code, notes, and snippets.

@jean
Created May 14, 2014 09:43
Show Gist options
  • Save jean/cb97a78ffafd53982284 to your computer and use it in GitHub Desktop.
Save jean/cb97a78ffafd53982284 to your computer and use it in GitHub Desktop.
> /home/jean/venv/local/lib/python2.7/site-packages/pkg_resources.py(2264)load()
-> for attr in self.attrs:
(Pdb) l
2259 if require: self.require(env, installer)
2260 try:
2261 entry = __import__(self.module_name, globals(),globals(), ['__name__'])
2262 except:
2263 import pdb; pdb.set_trace()
2264 -> for attr in self.attrs:
2265 try:
2266 entry = getattr(entry,attr)
2267 except AttributeError:
2268 raise ImportError("%r has no %r attribute" % (entry,attr))
2269 return entry
(Pdb) self.module_name
'mypkg.recipe.postgres'
(Pdb) import mypkg
(Pdb) mypkg.__path__
['/home/jean/venv/local/lib/python2.7/site-packages/mypkg', '/home/jean/venv/lib/python2.7/site-packages/mypkg']
@jean
Copy link
Author

jean commented May 14, 2014

14:13 jean@klippie:~/venv$ ls /home/jean/venv/local/lib/python2.7/site-packages/mypkg
ls: cannot access /home/jean/venv/local/lib/python2.7/site-packages/mypkg: No such file or directory

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment