jaraco / irc

Full-featured Python IRC library for Python.
MIT License
390 stars 85 forks source link

AttributeError: 'module' object has no attribute 'wraps' #124

Closed ghost closed 7 years ago

ghost commented 7 years ago

After I installed the IRC project by python setup install , some errors occured . Any leads?

🐟 ~/D/c/t/irc python ./irc/server.py
Traceback (most recent call last):
  File "./irc/server.py", line 45, in <module>
    import argparse
  File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/argparse.py", line 92, in <module>
    from gettext import gettext as _
  File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/gettext.py", line 49, in <module>
    import locale, copy, os, re, struct, sys
  File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/locale.py", line 112, in <module>
    @functools.wraps(_localeconv)
AttributeError: 'module' object has no attribute 'wraps'
jaraco commented 7 years ago

By invoking irc/server.py, the modules from the irc package are now appearing on your sys.path, which causes irc.functools to appear as functools and masks the stdlib module of the same name.

What you need to do is invoke the module using python -m irc.server, which will allow the module to run in the context of its package and not mask stdlib modules. I'll update the docs to help avoid this situation in the future.

ghost commented 7 years ago

Thanks a lot for your help.The problem was solved .(^○^)