-
-
Notifications
You must be signed in to change notification settings - Fork 1.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
AttributeError: 'module' object has no attribute 'command' #4
Comments
Closed for the time being. If you can show me a traceback I will repoen it. At the moment closed for "works for me". |
I am having the same problem on an Ubuntu 14.04 with python 2.7. Click installed via pip. Note I am very new to python, so I might have done something wrong. However, I copy/pasted the example code from the clip homepage: jurian@kaia:~/test$ cat __init__.py
import click
@click.command()
@click.option('--count', default=1, help='number of greetings')
@click.option('--name', prompt='Your name',
help='the person to greet', required=True)
def hello(count, name):
for x in range(count):
click.echo('Hello %s!' % name)
if __name__ == '__main__':
hello()
jurian@kaia:~/test$ python __init__.py --name=Jurian
Traceback (most recent call last):
File "__init__.py", line 12, in <module>
hello()
File "/usr/local/lib/python2.7/dist-packages/click/core.py", line 320, in __call__
return self.main(*args, **kwargs)
File "/usr/local/lib/python2.7/dist-packages/click/core.py", line 304, in main
self.invoke(ctx)
File "/usr/local/lib/python2.7/dist-packages/click/core.py", line 276, in invoke
ctx.invoke(self.callback, **ctx.params)
File "/usr/local/lib/python2.7/dist-packages/click/core.py", line 169, in invoke
return callback(*args, **kwargs)
File "__init__.py", line 9, in hello
click.echo('Hello %s!' % name)
AttributeError: 'module' object has no attribute 'echo' Here it's about the "echo" and not "command", but the type of error should be the same I guess. If you need more info, I can show some more. |
That's just an old version of click. |
I'm getting the same issue on the latest version of click
|
Obvious error, my file was called click.py, so when using |
i also named mine "click.py", thanks for the hint @FredoJones . |
Resurfaced Python 2.7.10 on Mac El Capitan Click: 6.6 `
|
Don't name your file |
Don't name your file click.py is correct answer. |
I downloaded master branch few min agao.And installed it on windows 7 with python 2.7.5.
While import click it give me error
AttributeError: 'module' object has no attribute 'command'
The text was updated successfully, but these errors were encountered: