How to include and use .eggs/pkg_resources within a project directory targeting python 2.5.1

非 Y 不嫁゛ 提交于 2019-12-06 03:49:04

If you want to be able to use pkg_resources, just copy pkg_resources.py alongside your application's main script. It's designed to be able to be used this way as a standalone runtime.

Include pkg_resources.py in the lib/ directory.

Add at the top of example.py...

   import sys
   sys.path.append("lib/")
   import pkg_resources

and then you can...

   sys.path.append("library1.egg")
   sys.path.append("libs/library2.egg")
   import library1
   import library2
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!