Hacktoberfest 2026: the issues maintainers tagged for October, open and beginner-friendly. Browse Hacktoberfest issues

invoke 2.1.3 does not work when run inside bash

Open
#955 0 comments 5 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
3/5
Estimated time
1-2 days
Newbie friendliness
38/100
Issue type
Bug
Clarity
Mostly clear
Activity status
Stale
Tech stack
python
Domain
cli

Research direction

Reproduce the issue with the shown tasks.py, tasks/init.py, tasks/build.py, and tasks/tests.py structure using both direct invocation and bash -c "invoke -l -d". Compare the loader output for each command, focusing on why the tasks.py module is selected in the shell case. Done means the defined tasks are discovered consistently in both invocation modes.

Written by the indexing model from the issue text.

Description

I have a typical folder structure with:

/tasks.py
/tasks/__init__.py
/tasks/build.py
/tasks/tests.py

Everything runes with 2.0.0, but after upgrading to 2.1.3 tasks are not found anymore.

When run invoke -l -d I get a working output:

invoke.program.parse_collection: No default namespace provided, trying to load one from disk
invoke.loader.find: FilesystemLoader find starting at '/Users/alexander.petermann/projects/abc'
invoke.loader.find: Found module: '/Users/alexander.petermann/projects/abc/tasks'
invoke.config._load_file: Didn't see any /Users/alexander.petermann/projects/abc/invoke.yaml, skipping.
....

but if I call invoke inside a bash script OR like bash -c "invoke -l -d", invoke will not find the defined tasks:

invoke.program.parse_collection: No default namespace provided, trying to load one from disk
invoke.loader.find: FilesystemLoader find starting at '/Users/alexander.petermann/projects/abc'
invoke.loader.find: Found module: ModuleSpec(name='tasks', loader=<_frozen_importlib_external.SourceFileLoader object at 0x1015fe1d0>, origin='/Users/alexander.petermann/projects/abc/tasks.py')
invoke.config._load_file: Didn't see any /Users/alexander.petermann/projects/abc/invoke.yaml, skipping.
...
Dominant language
Python
Stars
4.8k
Forks
412
PR merge metrics
No merged PRs in 30d

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from pyinvoke/invoke

All issues in pyinvoke/invoke

Similar issues

More Python issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.