Pytest -m connection error (dash)

Hi team,

First post on here so do let me know if there’s best practices I’m not adhering to. I’ve followed the instruction to set up my virtual environment (mflix), activated in and installed the requirements.txt file. However, upon running the initial pytest check for the connection, pytest -m connection, I’m presented with the following error, which appears to link to Dash:

Traceback (most recent call last):
  File "/Users/hasanparvez/.pyenv/versions/3.9.1/lib/python3.9/site-packages/pluggy/__init__.py", line 397, in load_setuptools_entrypoints
    plugin = ep.load()
  File "/Users/hasanparvez/.pyenv/versions/3.9.1/lib/python3.9/site-packages/pkg_resources/__init__.py", line 2460, in load
    self.require(*args, **kwargs)
  File "/Users/hasanparvez/.pyenv/versions/3.9.1/lib/python3.9/site-packages/pkg_resources/__init__.py", line 2483, in require
    items = working_set.resolve(reqs, env, installer, extras=self.extras)
  File "/Users/hasanparvez/.pyenv/versions/3.9.1/lib/python3.9/site-packages/pkg_resources/__init__.py", line 790, in resolve
    raise VersionConflict(dist, req).with_context(dependent_req)
pkg_resources.VersionConflict: (dash-core-components 1.16.0 (/Users/hasanparvez/.pyenv/versions/3.9.1/lib/python3.9/site-packages), Requirement.parse('dash-core-components==1.15.0'))

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/Users/hasanparvez/.pyenv/versions/3.9.1/bin/pytest", line 8, in <module>
    sys.exit(main())
  File "/Users/hasanparvez/.pyenv/versions/3.9.1/lib/python3.9/site-packages/_pytest/config.py", line 50, in main
    config = _prepareconfig(args, plugins)
  File "/Users/hasanparvez/.pyenv/versions/3.9.1/lib/python3.9/site-packages/_pytest/config.py", line 159, in _prepareconfig
    return pluginmanager.hook.pytest_cmdline_parse(
  File "/Users/hasanparvez/.pyenv/versions/3.9.1/lib/python3.9/site-packages/pluggy/__init__.py", line 617, in __call__
    return self._hookexec(self, self._nonwrappers + self._wrappers, kwargs)
  File "/Users/hasanparvez/.pyenv/versions/3.9.1/lib/python3.9/site-packages/pluggy/__init__.py", line 222, in _hookexec
    return self._inner_hookexec(hook, methods, kwargs)
  File "/Users/hasanparvez/.pyenv/versions/3.9.1/lib/python3.9/site-packages/pluggy/__init__.py", line 214, in <lambda>
    hook.multicall(
  File "/Users/hasanparvez/.pyenv/versions/3.9.1/lib/python3.9/site-packages/pluggy/callers.py", line 196, in _multicall
    gen.send(outcome)
  File "/Users/hasanparvez/.pyenv/versions/3.9.1/lib/python3.9/site-packages/_pytest/helpconfig.py", line 68, in pytest_cmdline_parse
    config = outcome.get_result()
  File "/Users/hasanparvez/.pyenv/versions/3.9.1/lib/python3.9/site-packages/pluggy/callers.py", line 76, in get_result
    raise ex[1].with_traceback(ex[2])
  File "/Users/hasanparvez/.pyenv/versions/3.9.1/lib/python3.9/site-packages/pluggy/callers.py", line 180, in _multicall
    res = hook_impl.function(*args)
  File "/Users/hasanparvez/.pyenv/versions/3.9.1/lib/python3.9/site-packages/_pytest/config.py", line 942, in pytest_cmdline_parse
    self.parse(args)
  File "/Users/hasanparvez/.pyenv/versions/3.9.1/lib/python3.9/site-packages/_pytest/config.py", line 1107, in parse
    self._preparse(args, addopts=addopts)
  File "/Users/hasanparvez/.pyenv/versions/3.9.1/lib/python3.9/site-packages/_pytest/config.py", line 1070, in _preparse
    self.pluginmanager.load_setuptools_entrypoints('pytest11')
  File "/Users/hasanparvez/.pyenv/versions/3.9.1/lib/python3.9/site-packages/pluggy/__init__.py", line 401, in load_setuptools_entrypoints
    raise PluginValidationError(
pluggy.PluginValidationError: Plugin 'dash' could not be loaded: (dash-core-components 1.16.0 (/Users/hasanparvez/.pyenv/versions/3.9.1/lib/python3.9/site-packages), Requirement.parse('dash-core-components==1.15.0'))!

Could you let me know what I might need to do to resolve this?

In addition to the above, I’ve noted that when running the requirement.txt, I get the following conflict which should explain the above issue:

dash 1.19.0 requires Flask>=1.0.4, but you’ll have flask 0.12.4 which is incompatible.

Apparently this error is solved by typing pip install dash[testing]

You can read more info here - Dash Testing | Dash for Python Documentation | Plotly

1 Like