Sick of pkg_resources Warnings?
Create a sitecustomize.py in your site-packages with the following code:
import warnings
warnings.filterwarnings('ignore',
message=r'Module .*? is being added to sys.path', append=True)
the fruity and personal webpage of armin ronacher
Create a sitecustomize.py in your site-packages with the following code:
import warnings
warnings.filterwarnings('ignore',
message=r'Module .*? is being added to sys.path', append=True)
I think i get one of these? This is what I’ve been getting:
UserWarning: Module _mysql was already imported from /var/lib/python-support/python2\
Comment by Braydon Fuller — Tuesday, February 19th, 2008 @ 10:30 pm.5/_mysql.so, but /var/lib/python-support/python2.5 is being added to sys.path
import pkg_resources
Yes. Happens if you are playing with sys.path to inject another lib but there is an egg added later on. Especially for scripts very annoying.
Comment by Armin Ronacher — Tuesday, February 19th, 2008 @ 11:04 pmIt is very annoying. I sidestepped the issue and tried the same using postgresql, and it went away. Weird thing is that for the wsgi bridge file I play with sys.path to import some modules, however I get this when I run the script that doesn’t append anything to the sys.path, so it must be happening someplace else.
Comment by Braydon Fuller — Tuesday, February 19th, 2008 @ 11:47 pm