Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ImportError for coverage.report.Reporter on AppVeyor #77

Open
dvorapa opened this issue Mar 24, 2020 · 4 comments
Open

ImportError for coverage.report.Reporter on AppVeyor #77

dvorapa opened this issue Mar 24, 2020 · 4 comments

Comments

@dvorapa
Copy link

dvorapa commented Mar 24, 2020

coveralls
Traceback (most recent call last):
  File "c:\python27\Lib\runpy.py", line 174, in _run_module_as_main
    "__main__", fname, loader, pkg_name)
  File "c:\python27\Lib\runpy.py", line 72, in _run_code
    exec code in run_globals
  File "C:\projects\pywikibot\env\Scripts\coveralls.exe\__main__.py", line 7, in <module>
  File "c:\projects\pywikibot\env\lib\site-packages\coveralls\__init__.py", line 78, in wear
    from coveralls.control import coveralls
  File "c:\projects\pywikibot\env\lib\site-packages\coveralls\control.py", line 2, in <module>
    from coveralls.report import CoverallsReporter
  File "c:\projects\pywikibot\env\lib\site-packages\coveralls\report.py", line 6, in <module>
    from coverage.report import Reporter
ImportError: cannot import name Reporter
@Deuchnord
Copy link

Deuchnord commented Jun 6, 2020

Having the same issue with Github Action. Did you find a solution?

Edit: found solution in #74. You have to install coveralls package instead of python-coveralls.

@dvorapa
Copy link
Author

dvorapa commented Jun 6, 2020

Yes, I found the same solution.

@blag
Copy link

blag commented Jul 22, 2020

Same problem on Travis.

@prjemian
Copy link

These exceptions are not specific to AppVeyor and still occur today. Executing within GitHubActions workflow with Py 3.8, 3.9, 3.10, 3.11 and installation from conda-forge:

  • Without installation of either coveralls or python-coveralls, get missing package, as expected.
  • With only coveralls 1.8.0 installed (from conda-forge), get the identical Exception in the title of this issue.
  • With only python-coveralls 2.9.3 installed (from conda-forge), get the identical Exception in the title of this issue.

Here's an Exception trace from one of the workflows.

List of packages in environment: "/home/runner/micromamba-root/envs/anaconda-test-env-py-3.8"

  Name              Version  Build  Channel    
─────────────────────────────────────────────────
  python-coveralls  2.9.3    py_0   conda-forge
/home/runner/micromamba-root/envs/anaconda-test-env-py-3.8/bin/coveralls
Traceback (most recent call last):
  File "/home/runner/micromamba-root/envs/anaconda-test-env-py-3.8/bin/coveralls", line 10, in <module>
    sys.exit(wear())
  File "/home/runner/micromamba-root/envs/anaconda-test-env-py-3.8/lib/python3.8/site-packages/coveralls/__init__.py", line [78](https://github.com/prjemian/spec2nexus/actions/runs/3759487949/jobs/6389108203#step:6:79), in wear
    from coveralls.control import coveralls
  File "/home/runner/micromamba-root/envs/anaconda-test-env-py-3.8/lib/python3.8/site-packages/coveralls/control.py", line 2, in <module>
    from coveralls.report import CoverallsReporter
  File "/home/runner/micromamba-root/envs/anaconda-test-env-py-3.8/lib/python3.8/site-packages/coveralls/report.py", line 6, in <module>
    from coverage.report import Reporter
ImportError: cannot import name 'Reporter' from 'coverage.report' (/home/runner/micromamba-root/envs/anaconda-test-env-py-3.8/lib/python3.8/site-packages/coverage/report.py)
Error: Process completed with exit code 1.

The coverage package reports that coverage.report.Reporter has been deprecated in release 5.0. Current release (just a few days ago) is 7.0.

It is coveralls/report.py, line 6 that calls from coverage.report import Reporter. That's the problem.

To avoid this problem now, should we pin coverage<5 when using coveralls? This still fails with a conda/micromamba install. Switching to pip install for these two packages. And this worked.

Summary: Do not install coverage and coveralls with conda, use pip. And do not install python-coveralls at the same time.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants