Ticket - Projection solved

Hello,

I was getting an error while running pytest -m projection. I read many threads but couldn’t find the similar problem. Logically the code was perfect. After wasting 2 days I simply removed the virtual environment and reinstalled the requirement.txt. And it worked. I have faced similar issue in my previous assignment and that time also I did the same thing and it worked. So I am wondering is it the case that the changes made by previous assignments is not compatible with the next assignment?

Here is the kind of error that I was getting. Posting this if it helps someone. Also let me know if my understanding is wrong.

Thank you,
Deepali Rawool

pytest -m projection
Traceback (most recent call last):
  File "/opt/anaconda3/bin/pytest", line 11, in <module>
    sys.exit(main())
  File "/opt/anaconda3/lib/python3.7/site-packages/_pytest/config/__init__.py", line 73, in main
    config = _prepareconfig(args, plugins)
  File "/opt/anaconda3/lib/python3.7/site-packages/_pytest/config/__init__.py", line 224, in _prepareconfig
    pluginmanager=pluginmanager, args=args
  File "/opt/anaconda3/lib/python3.7/site-packages/pluggy/hooks.py", line 286, in __call__
    return self._hookexec(self, self.get_hookimpls(), kwargs)
  File "/opt/anaconda3/lib/python3.7/site-packages/pluggy/manager.py", line 93, in _hookexec
    return self._inner_hookexec(hook, methods, kwargs)
  File "/opt/anaconda3/lib/python3.7/site-packages/pluggy/manager.py", line 87, in <lambda>
    firstresult=hook.spec.opts.get("firstresult") if hook.spec else False,
  File "/opt/anaconda3/lib/python3.7/site-packages/pluggy/callers.py", line 203, in _multicall
    gen.send(outcome)
  File "/opt/anaconda3/lib/python3.7/site-packages/_pytest/helpconfig.py", line 89, in pytest_cmdline_parse
    config = outcome.get_result()
  File "/opt/anaconda3/lib/python3.7/site-packages/pluggy/callers.py", line 80, in get_result
    raise ex[1].with_traceback(ex[2])
  File "/opt/anaconda3/lib/python3.7/site-packages/pluggy/callers.py", line 187, in _multicall
    res = hook_impl.function(*args)
  File "/opt/anaconda3/lib/python3.7/site-packages/_pytest/config/__init__.py", line 794, in pytest_cmdline_parse
    self.parse(args)
  File "/opt/anaconda3/lib/python3.7/site-packages/_pytest/config/__init__.py", line 1000, in parse
    self._preparse(args, addopts=addopts)
  File "/opt/anaconda3/lib/python3.7/site-packages/_pytest/config/__init__.py", line 948, in _preparse
    self.pluginmanager.load_setuptools_entrypoints("pytest11")
  File "/opt/anaconda3/lib/python3.7/site-packages/pluggy/manager.py", line 299, in load_setuptools_entrypoints
    plugin = ep.load()
  File "/opt/anaconda3/lib/python3.7/site-packages/importlib_metadata/__init__.py", line 92, in load
    module = import_module(match.group('module'))
  File "/opt/anaconda3/lib/python3.7/importlib/__init__.py", line 127, in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
  File "<frozen importlib._bootstrap>", line 1006, in _gcd_import
  File "<frozen importlib._bootstrap>", line 983, in _find_and_load
  File "<frozen importlib._bootstrap>", line 953, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 219, in _call_with_frames_removed
  File "<frozen importlib._bootstrap>", line 1006, in _gcd_import
  File "<frozen importlib._bootstrap>", line 983, in _find_and_load
  File "<frozen importlib._bootstrap>", line 953, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 219, in _call_with_frames_removed
  File "<frozen importlib._bootstrap>", line 1006, in _gcd_import
  File "<frozen importlib._bootstrap>", line 983, in _find_and_load
  File "<frozen importlib._bootstrap>", line 967, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 677, in _load_unlocked
  File "/opt/anaconda3/lib/python3.7/site-packages/_pytest/assertion/rewrite.py", line 143, in exec_module
    exec(co, module.__dict__)
  File "/opt/anaconda3/lib/python3.7/site-packages/hypothesis/__init__.py", line 26, in <module>
    from hypothesis.core import example, find, given, reproduce_failure, seed
  File "<frozen importlib._bootstrap>", line 983, in _find_and_load
  File "<frozen importlib._bootstrap>", line 967, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 677, in _load_unlocked
  File "/opt/anaconda3/lib/python3.7/site-packages/_pytest/assertion/rewrite.py", line 143, in exec_module
    exec(co, module.__dict__)
  File "/opt/anaconda3/lib/python3.7/site-packages/hypothesis/core.py", line 67, in <module>
    from hypothesis.internal.conjecture.engine import ConjectureRunner, sort_key
  File "<frozen importlib._bootstrap>", line 983, in _find_and_load
  File "<frozen importlib._bootstrap>", line 967, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 677, in _load_unlocked
  File "/opt/anaconda3/lib/python3.7/site-packages/_pytest/assertion/rewrite.py", line 143, in exec_module
    exec(co, module.__dict__)
  File "/opt/anaconda3/lib/python3.7/site-packages/hypothesis/internal/conjecture/engine.py", line 41, in <module>
    from hypothesis.internal.conjecture.pareto import NO_SCORE, ParetoFront, ParetoOptimiser
  File "<frozen importlib._bootstrap>", line 983, in _find_and_load
  File "<frozen importlib._bootstrap>", line 967, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 677, in _load_unlocked
  File "/opt/anaconda3/lib/python3.7/site-packages/_pytest/assertion/rewrite.py", line 143, in exec_module
    exec(co, module.__dict__)
  File "/opt/anaconda3/lib/python3.7/site-packages/hypothesis/internal/conjecture/pareto.py", line 22, in <module>
    from hypothesis.internal.conjecture.shrinker import sort_key
  File "<frozen importlib._bootstrap>", line 983, in _find_and_load
  File "<frozen importlib._bootstrap>", line 967, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 677, in _load_unlocked
  File "/opt/anaconda3/lib/python3.7/site-packages/_pytest/assertion/rewrite.py", line 143, in exec_module
    exec(co, module.__dict__)
  File "/opt/anaconda3/lib/python3.7/site-packages/hypothesis/internal/conjecture/shrinker.py", line 1447, in <module>
    @attr.s(slots=True, eq=False)
TypeError: attrs() got an unexpected keyword argument 'eq'

Definitively not.

Post a screenshot of the terminal where you ran the test pytest and did not work. We get more information from a screenshot as we see the context where and how you entered the command.

Most likely the virtual env was not activated at the time you ran the test. The clue to this is you got error from /…/site-packages/… rather than project specific modules/files. By

you most likely installed the required in the global package directory.

Hello @steevej,
I do have multiple virtual environments set up and I created mflix venv through anaconda navigator and installed requirement.txt from the command line (not sure if that has caused any issue) . I ran the test from mflix virtual environment. Here is the screen shot.

Thank you,
Deepali