Skip to content

CI fails on master with ModuleNotFoundError for MacOS #6147

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

Closed
tanujkhattar opened this issue Jun 21, 2023 · 3 comments
Closed

CI fails on master with ModuleNotFoundError for MacOS #6147

tanujkhattar opened this issue Jun 21, 2023 · 3 comments
Assignees
Labels
kind/health For CI/testing/release process/refactoring/technical debt items priority/p0 Needs urgent attention and a hotfix release, breaks the majority of users

Comments

@tanujkhattar
Copy link
Collaborator

Description of the issue
The issue seems to be related to pandas. See logs from a failed run - https://github.com/quantumlib/Cirq/actions/runs/5328915438/jobs/9654061191?pr=6122

``` Run check/pytest -n auto --ignore=cirq-core/cirq/contrib /Users/runner/hostedtoolcache/Python/3.7.17/x[6](https://github.com/quantumlib/Cirq/actions/runs/5328915438/jobs/9654061191?pr=6122#step:6:7)4/lib/python3.[7](https://github.com/quantumlib/Cirq/actions/runs/5328915438/jobs/9654061191?pr=6122#step:6:8)/site-packages/xdist/dsession.py:70: PytestDeprecationWarning: The hookimpl DSession.pytest_sessionstart uses old-style configuration options (marks or attributes). ============================= test session starts ============================== Please use the pytest.hookimpl(trylast=True) decorator instead platform darwin -- Python 3.7.17, pytest-7.3.2, pluggy-1.0.0 to configure the hooks. Using --randomly-seed=1267634636 See https://docs.pytest.org/en/latest/deprecations.html#configuring-hook-specs-impls-using-markers rootdir: /Users/runner/work/Cirq/Cirq @pytest.mark.trylast configfile: pyproject.toml /Users/runner/hostedtoolcache/Python/3.7.17/x64/lib/python3.7/site-packages/xdist/dsession.py:93: PytestDeprecationWarning: The hookimpl DSession.pytest_xdist_make_scheduler uses old-style configuration options (marks or attributes). plugins: asyncio-0.21.0, cov-4.1.0, xdist-2.2.1, randomly-3.12.0, forked-1.6.0, anyio-3.7.0 Please use the pytest.hookimpl(trylast=True) decorator instead asyncio: mode=strict to configure the hooks. gw0 I / gw1 I / gw2 I See https://docs.pytest.org/en/latest/deprecations.html#configuring-hook-specs-impls-using-markers gw0 [0] / gw1 [0] / gw2 [0] @pytest.mark.trylast

==================================== ERRORS ====================================
________________________ ERROR collecting test session _________________________
../../../hostedtoolcache/Python/3.7.17/x64/lib/python3.7/importlib/init.py:127: in import_module
return _bootstrap._gcd_import(name[level:], package, level)
:1006: in _gcd_import
???
:983: in _find_and_load
???
:953: in _find_and_load_unlocked
???
:219: in _call_with_frames_removed
???
:1006: in _gcd_import
???
:983: in _find_and_load
???
:967: in _find_and_load_unlocked
???
:677: in _load_unlocked
???
:728: in exec_module
???
:219: in _call_with_frames_removed
???
cirq-aqt/cirq_aqt/init.py:19: in
from cirq_aqt.aqt_sampler import AQTSampler, AQTSamplerLocalSimulator
cirq-aqt/cirq_aqt/aqt_sampler.py:33: in
import cirq
cirq-core/cirq/init.py:19: in
from cirq._compat import cirq_debug, with_debug
cirq-core/cirq/_compat.py:31: in
import pandas as pd
../../../hostedtoolcache/Python/3.7.17/x64/lib/python3.7/site-packages/pandas/init.py:50: in
from pandas.core.api import (
../../../hostedtoolcache/Python/3.7.17/x64/lib/python3.7/site-packages/pandas/core/api.py:48: in
from pandas.core.groupby import (
../../../hostedtoolcache/Python/3.7.17/x64/lib/python3.7/site-packages/pandas/core/groupby/init.py:1: in
from pandas.core.groupby.generic import (
../../../hostedtoolcache/Python/3.7.17/x64/lib/python3.7/site-packages/pandas/core/groupby/generic.py:73: in
from pandas.core.frame import DataFrame
../../../hostedtoolcache/Python/3.7.17/x64/lib/python3.7/site-packages/pandas/core/frame.py:129: in
from pandas.core import (
../../../hostedtoolcache/Python/3.7.17/x64/lib/python3.7/site-packages/pandas/core/generic.py:122: in
from pandas.core.describe import describe_ndframe
../../../hostedtoolcache/Python/3.7.17/x64/lib/python3.7/site-packages/pandas/core/describe.py:39: in
from pandas.io.formats.format import format_percentiles
../../../hostedtoolcache/Python/3.7.17/x64/lib/python3.7/site-packages/pandas/io/formats/format.py:99: in
from pandas.io.common import stringify_path
../../../hostedtoolcache/Python/3.7.17/x64/lib/python3.7/site-packages/pandas/io/common.py:4: in
import bz2
../../../hostedtoolcache/Python/3.7.17/x64/lib/python3.7/bz2.py:19: in
from _bz2 import BZ2Compressor, BZ2Decompressor
E ModuleNotFoundError: No module named '_bz2'
________________________ ERROR collecting test session _________________________
../../../hostedtoolcache/Python/3.7.17/x64/lib/python3.7/importlib/init.py:127: in import_module
return _bootstrap._gcd_import(name[level:], package, level)
:1006: in _gcd_import
???
:983: in _find_and_load
???
:953: in _find_and_load_unlocked
???
:219: in _call_with_frames_removed
???
:1006: in _gcd_import
???
:983: in _find_and_load
???
:967: in _find_and_load_unlocked
???
:677: in _load_unlocked
???
:728: in exec_module
???
:219: in _call_with_frames_removed
???
cirq-aqt/cirq_aqt/init.py:19: in
from cirq_aqt.aqt_sampler import AQTSampler, AQTSamplerLocalSimulator
cirq-aqt/cirq_aqt/aqt_sampler.py:33: in
import cirq
cirq-core/cirq/init.py:19: in
from cirq._compat import cirq_debug, with_debug
cirq-core/cirq/_compat.py:31: in
import pandas as pd
../../../hostedtoolcache/Python/3.7.17/x64/lib/python3.7/site-packages/pandas/init.py:50: in
from pandas.core.api import (
../../../hostedtoolcache/Python/3.7.17/x64/lib/python3.7/site-packages/pandas/core/api.py:48: in
from pandas.core.groupby import (
../../../hostedtoolcache/Python/3.7.17/x64/lib/python3.7/site-packages/pandas/core/groupby/init.py:1: in
from pandas.core.groupby.generic import (
../../../hostedtoolcache/Python/3.7.17/x64/lib/python3.7/site-packages/pandas/core/groupby/generic.py:73: in
from pandas.core.frame import DataFrame
../../../hostedtoolcache/Python/3.7.17/x64/lib/python3.7/site-packages/pandas/core/frame.py:129: in
from pandas.core import (
../../../hostedtoolcache/Python/3.7.17/x64/lib/python3.7/site-packages/pandas/core/generic.py:122: in
from pandas.core.describe import describe_ndframe
../../../hostedtoolcache/Python/3.7.17/x64/lib/python3.7/site-packages/pandas/core/describe.py:39: in
from pandas.io.formats.format import format_percentiles
../../../hostedtoolcache/Python/3.7.17/x64/lib/python3.7/site-packages/pandas/io/formats/format.py:99: in
from pandas.io.common import stringify_path
../../../hostedtoolcache/Python/3.7.17/x64/lib/python3.7/site-packages/pandas/io/common.py:4: in
import bz2
../../../hostedtoolcache/Python/3.7.17/x64/lib/python3.7/bz2.py:19: in
from _bz2 import BZ2Compressor, BZ2Decompressor
E ModuleNotFoundError: No module named '_bz2'
________________________ ERROR collecting test session _________________________
../../../hostedtoolcache/Python/3.7.17/x64/lib/python3.7/importlib/init.py:127: in import_module
return _bootstrap._gcd_import(name[level:], package, level)
:1006: in _gcd_import
???
:983: in _find_and_load
???
:953: in _find_and_load_unlocked
???
:219: in _call_with_frames_removed
???
:1006: in _gcd_import
???
:983: in _find_and_load
???
:967: in _find_and_load_unlocked
???
:677: in _load_unlocked
???
:728: in exec_module
???
:219: in _call_with_frames_removed
???
cirq-aqt/cirq_aqt/init.py:19: in
from cirq_aqt.aqt_sampler import AQTSampler, AQTSamplerLocalSimulator
cirq-aqt/cirq_aqt/aqt_sampler.py:33: in
import cirq
cirq-core/cirq/init.py:19: in
from cirq._compat import cirq_debug, with_debug
cirq-core/cirq/_compat.py:31: in
import pandas as pd
../../../hostedtoolcache/Python/3.7.17/x64/lib/python3.7/site-packages/pandas/init.py:50: in
from pandas.core.api import (
../../../hostedtoolcache/Python/3.7.17/x64/lib/python3.7/site-packages/pandas/core/api.py:48: in
from pandas.core.groupby import (
../../../hostedtoolcache/Python/3.7.17/x64/lib/python3.7/site-packages/pandas/core/groupby/init.py:1: in
from pandas.core.groupby.generic import (
../../../hostedtoolcache/Python/3.7.17/x64/lib/python3.7/site-packages/pandas/core/groupby/generic.py:73: in
from pandas.core.frame import DataFrame
../../../hostedtoolcache/Python/3.7.17/x64/lib/python3.7/site-packages/pandas/core/frame.py:129: in
from pandas.core import (
../../../hostedtoolcache/Python/3.7.17/x64/lib/python3.7/site-packages/pandas/core/generic.py:122: in
from pandas.core.describe import describe_ndframe
../../../hostedtoolcache/Python/3.7.17/x64/lib/python3.7/site-packages/pandas/core/describe.py:39: in
from pandas.io.formats.format import format_percentiles
../../../hostedtoolcache/Python/3.7.17/x64/lib/python3.7/site-packages/pandas/io/formats/format.py:99: in
from pandas.io.common import stringify_path
../../../hostedtoolcache/Python/3.7.17/x64/lib/python3.7/site-packages/pandas/io/common.py:4: in
import bz2
../../../hostedtoolcache/Python/3.7.17/x64/lib/python3.7/bz2.py:19: in
from _bz2 import BZ2Compressor, BZ2Decompressor
E ModuleNotFoundError: No module named '_bz2'
=========================== short test summary info ============================
ERROR - ModuleNotFoundError: No module named '_bz2'
ERROR - ModuleNotFoundError: No module named '_bz2'
ERROR - ModuleNotFoundError: No module named '_bz2'
============================== 3 errors in 5.83s ===============================
Error: Process completed with exit code 1.

</details>
**Cirq version**
1.2.0.dev
@tanujkhattar tanujkhattar added kind/health For CI/testing/release process/refactoring/technical debt items priority/p0 Needs urgent attention and a hotfix release, breaks the majority of users labels Jun 21, 2023
@pavoljuhas
Copy link
Collaborator

Recent upgrade of GitHub runner images appears to include broken Python 3.7.17, where
python -c 'import bz2' fails with the same ModuleNotFoundError exception as above.

Reported as actions/runner-images#7764

pavoljuhas added a commit to pavoljuhas/Cirq that referenced this issue Jun 21, 2023
CI seems to provide broken installation.

Temporary workaround for quantumlib#6147
@pavoljuhas
Copy link
Collaborator

Another related bug report: actions/setup-python#682

@pavoljuhas
Copy link
Collaborator

Fixed by #6151

pavoljuhas added a commit that referenced this issue Jun 21, 2023
Use the latest versions of GitHub actions, namely

- update actions/checkout@v2 --> v3
- update actions/setup-python@v1 --> v4

Related to #6147
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/health For CI/testing/release process/refactoring/technical debt items priority/p0 Needs urgent attention and a hotfix release, breaks the majority of users
Projects
None yet
Development

No branches or pull requests

2 participants