CLI errors on some Python track exercises

Initially, solving the exercises locally worked fine but recently I keep getting an error. Testing still works fine on the on the others I had done before but not on any new downloaded exercises. Any help will be greatly appreciated. Following is the error message from Ellen’s Alien game.

Traceback (most recent call last):
  File "<frozen runpy>", line 198, in _run_module_as_main
  File "<frozen runpy>", line 88, in _run_code
  File "/home/madzi/exercism/python/ellens-alien-game/env/lib/python3.11/site-packages/pytest/__main__.py", line 5, in <module>
    raise SystemExit(pytest.console_main())
                     ^^^^^^^^^^^^^^^^^^^^^
  File "/home/madzi/exercism/python/ellens-alien-game/env/lib/python3.11/site-packages/_pytest/config/__init__.py", line 192, in console_main
    code = main()
           ^^^^^^
  File "/home/madzi/exercism/python/ellens-alien-game/env/lib/python3.11/site-packages/_pytest/config/__init__.py", line 150, in main
    config = _prepareconfig(args, plugins)
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/madzi/exercism/python/ellens-alien-game/env/lib/python3.11/site-packages/_pytest/config/__init__.py", line 331, in _prepareconfig
    config = pluginmanager.hook.pytest_cmdline_parse(
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/madzi/exercism/python/ellens-alien-game/env/lib/python3.11/site-packages/pluggy/_hooks.py", line 493, in __call__
    return self._hookexec(self.name, self._hookimpls, kwargs, firstresult)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/madzi/exercism/python/ellens-alien-game/env/lib/python3.11/site-packages/pluggy/_manager.py", line 115, in _hookexec
    return self._inner_hookexec(hook_name, methods, kwargs, firstresult)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/madzi/exercism/python/ellens-alien-game/env/lib/python3.11/site-packages/pluggy/_callers.py", line 130, in _multicall
    teardown[0].send(outcome)
  File "/home/madzi/exercism/python/ellens-alien-game/env/lib/python3.11/site-packages/_pytest/helpconfig.py", line 104, in pytest_cmdline_parse
    config: Config = outcome.get_result()
                     ^^^^^^^^^^^^^^^^^^^^
  File "/home/madzi/exercism/python/ellens-alien-game/env/lib/python3.11/site-packages/pluggy/_result.py", line 114, in get_result
    raise exc.with_traceback(exc.__traceback__)
  File "/home/madzi/exercism/python/ellens-alien-game/env/lib/python3.11/site-packages/pluggy/_callers.py", line 77, in _multicall
    res = hook_impl.function(*args)
          ^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/madzi/exercism/python/ellens-alien-game/env/lib/python3.11/site-packages/_pytest/config/__init__.py", line 1075, in pytest_cmdline_parse
    self.parse(args)
  File "/home/madzi/exercism/python/ellens-alien-game/env/lib/python3.11/site-packages/_pytest/config/__init__.py", line 1425, in parse
    self._preparse(args, addopts=addopts)
  File "/home/madzi/exercism/python/ellens-alien-game/env/lib/python3.11/site-packages/_pytest/config/__init__.py", line 1305, in _preparse
    self.pluginmanager.load_setuptools_entrypoints("pytest11")
  File "/home/madzi/exercism/python/ellens-alien-game/env/lib/python3.11/site-packages/pluggy/_manager.py", line 398, in load_setuptools_entrypoints
    plugin = ep.load()
             ^^^^^^^^^
  File "/usr/lib/python3.11/importlib/metadata/__init__.py", line 202, in load
    module = import_module(match.group('module'))
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.11/importlib/__init__.py", line 126, in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "<frozen importlib._bootstrap>", line 1206, in _gcd_import
  File "<frozen importlib._bootstrap>", line 1178, in _find_and_load
  File "<frozen importlib._bootstrap>", line 1149, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 690, in _load_unlocked
  File "/home/madzi/exercism/python/ellens-alien-game/env/lib/python3.11/site-packages/_pytest/assertion/rewrite.py", line 178, in exec_module
    exec(co, module.__dict__)
  File "/home/madzi/exercism/python/ellens-alien-game/env/lib/python3.11/site-packages/pytest_pylint/plugin.py", line 18, in <module>
    from .pylint_util import ProgrammaticReporter
  File "/home/madzi/exercism/python/ellens-alien-game/env/lib/python3.11/site-packages/_pytest/assertion/rewrite.py", line 178, in exec_module
    exec(co, module.__dict__)
  File "/home/madzi/exercism/python/ellens-alien-game/env/lib/python3.11/site-packages/pytest_pylint/pylint_util.py", line 5, in <module>
    from pylint.interfaces import IReporter
ImportError: cannot import name 'IReporter' from 'pylint.interfaces' (/home/madzi/exercism/python/ellens-alien-game/env/lib/python3.11/site-packages/pylint/interfaces.py)
  • What command are you running that triggers that error?
  • Can you share your code?

Here is the command.

python3 -m pytest -o markers=task classes_test.py

and here is my code.

"""Solution to Ellen's Alien Game exercise."""


class Alien:
    """Create an Alien object with location x_coordinate and y_coordinate.

    Attributes
    ----------
    (class)total_aliens_created: int
    x_coordinate: int - Position on the x-axis.
    y_coordinate: int - Position on the y-axis.
    health: int - Amount of health points.

    Methods
    -------
    hit(): Decrement Alien health by one point.
    is_alive(): Return a boolean for if Alien is alive (if health is > 0).
    teleport(new_x_coordinate, new_y_coordinate): Move Alien object to new coordinates.
    collision_detection(other): Implementation TBD.
    """
    total_aliens_created = 0

    def __init__(self, x_coord, y_coord):
        self.health = 3
        self.x_coordinate = x_coord
        self.y_coordinate = y_coord
        Alien.total_aliens_created += 1

    def hit(self):
        if self.health > 0:
            self.health -= 1

    def is_alive(self):
        if self.health > 0:
            return True
        return False

    def teleport(self, x_coord, y_coord):
        self.x_coordinate = x_coord
        self.y_coordinate = y_coord

    def collision_detection(self, alien):
        pass

# TODO:  create the new_aliens_collection() function below to call your Alien class with a list of coordinates.


def new_aliens_collection(positions):
    aliens = []
    for position in positions:
        aliens.append(Alien(*position))
    return aliens

I created a repository if it may be of more help.
ellen’s alien game

My gut reaction here is that your Python venv got messed up somehow. It might be worth deleting it and setting it back up and seeing if that helps. That error isn’t related to any of the Exercism files.

Ok will do, thanks a lot hey.