CumulusCI TaskImportError: Cannot load Python class for task - No module named 'imp'

59 views Asked by At

I'm working with CumulusCI on macOS and running into an issue when trying to run tests. Every time I attempt to run a test with the command cci task run robot -o suites path/to/salesforce.robot, I encounter the following TaskImportError:

Traceback (most recent call last):
  File "/Users/anaisemccrovitz/.local/pipx/venvs/cumulusci/lib/python3.12/site-packages/cumulusci/cli/cci.py", line 91, in main
    cli(args[1:], standalone_mode=False, obj=runtime)
  File "/Users/anaisemccrovitz/.local/pipx/venvs/cumulusci/lib/python3.12/site-packages/click/core.py", line 1157, in __call__
    return self.main(*args, **kwargs)
  ...
  File "/Users/anaisemccrovitz/.local/pipx/venvs/cumulusci/lib/python3.12/site-packages/cumulusci/core/config/__init__.py", line 90, in get_class
    raise TaskImportError(message) from e
cumulusci.core.exceptions.TaskImportError: Cannot load Python class for task:
No module named 'imp'

It seems like the module imp is missing, but I'm not sure why this would be the case since I'm using a virtual environment managed by pipx.

Here's what I have tried so far:

I've ensured that my virtual environment is activated. I've tried reinstalling CumulusCI to ensure all dependencies are correctly installed. I've checked for any issues related to Python path configurations. I'm running Python 3.12, BUT I have tried to use pyenv 3.9 and it has not reflected to work. and as far as I know, the imp module has been deprecated since Python 3.4 and should not be used.

Questions:

Could this issue be related to the Python version I'm using? How can I resolve this error and successfully run my tests with CumulusCI? Is there a workaround or a fix that I should apply to avoid this issue? Any help or pointers would be greatly appreciated!

0

There are 0 answers