6

module name: module references __file__

This appears several times when I install my own packages using easy_install and initial google search didn't bring any success.

I am fully aware that I'm using __file__ inside the modules, but there is nothing wrong about it.

How to I get rid of this message without removing __file__ references?

sorin
  • 161,544
  • 178
  • 535
  • 806
  • 1
    I'm not sure I understand what the question is. Would you mind clearly stating exactly what the question is for us? – chown Dec 02 '11 at 20:57
  • 1
    possible duplicate of [warnings emitted during 'easy_install'](http://stackoverflow.com/questions/2298403/warnings-emitted-during-easy-install) – Andrew Clark Dec 02 '11 at 21:18
  • You could use `easy_install --quiet INSERTMODHERE` or `easy_install INSERTMODHERE > /dev/null` or `easy_install INSERTMODHERE | grep -v "module references __file__"`, etc. – chown Dec 02 '11 at 21:30
  • Getting rid for all users installing the package, otherwise I could redirect everything to `/dev/null` :) – sorin Dec 02 '11 at 23:00

1 Answers1

10

Found this page while googling the same problem. The solution is:

Tell distutils that your package is not zip_safe (and that this is ok) like this:

setup (name = 'yourmodule',
   ...
   zip_safe = False,
   ...
   )

This way easy_install will not have to parse your module and will not complain about __file__ references.

Anton Lopatin
  • 116
  • 2
  • 3