Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Python Invoke - Can't find any collection named 'tasks'!

I did the getting started on Python Invoke

from invoke import task

@task
def build():
    print("Building!")

The expected output is

$ invoke build
Building!

However, my output is

$ invoke build
Can't find any collection named 'tasks'!

I have no idea why.

Something amazing is, once I invoke in the virtualenv, then I can build without virtualenv.

> mkvirtualenv myenv
> invoke build
Building!
> deactivate myenv
> invoke build
Building!

Did I miss something?

like image 363
Asoul Avatar asked Aug 18 '15 16:08

Asoul


1 Answers

According to documentation your file containing task should be named tasks.py. Make sure you are running build from the same directory as tasks.py, too

like image 94
hspandher Avatar answered Sep 21 '22 19:09

hspandher