Masking a dist package with a copy in my own package

Sam Simmons sam at samiconductor.com
Fri Jan 20 22:46:24 EST 2012


Hey all,

I'm using twisted in a project and have run into a class that's in version 11.1 but not 8.2 in OSX. I was thinking to get it working for mac users I could just extract the 11.1 twisted package and through it under my package. e.g.

project/
  __init__.py
  twisted/
    __init__.py
  ...

When running anything, it imports from the local 11.1 twisted, but zope throws a warning:

/System/Library/Frameworks/Python.framework/Versions/2.6/Extras/lib/python/zope/__init__.py:1: UserWarning: Module twisted was already imported from /path/to/project/twisted/__init__.pyc, but /System/Library/Frameworks/Python.framework/Versions/2.6/Extras/lib/python is being added to sys.path
  __import__('pkg_resources').declare_namespace(__name__)

Is there an elegant way to give mac users vers 11.1 other than copying in package and possibly renaming it?

Thanks!



More information about the Python-list mailing list