You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I have checked that this issue has not already been reported.
I have confirmed this bug exists on the latest version of pandas.
I have confirmed this bug exists on the main branch of pandas.
Reproducible Example
importpandasaspd
Issue Description
On some Python installations, the libbzip2 headers are not compiled into Python. This is also true on some lightweight Python binaries, including (recently) several used by GitHub actions. It does not make much sense for pandas to require bz2 if one is not doing bzip compression, so I think this import should be safely skipped if not available.
Using /Users/runner/hostedtoolcache/Python/3.7.17/x64/lib/python3.7/site-packages
Finished processing dependencies for pysr==0.14.2
Traceback (most recent call last):
File "/Users/runner/hostedtoolcache/Python/3.7.17/x64/lib/python3.7/runpy.py", line 183, in _run_module_as_main
mod_name, mod_spec, code = _get_module_details(mod_name, _Error)
File "/Users/runner/hostedtoolcache/Python/3.7.17/x64/lib/python3.7/runpy.py", line 142, in _get_module_details
return _get_module_details(pkg_main_name, error)
File "/Users/runner/hostedtoolcache/Python/3.7.17/x64/lib/python3.7/runpy.py", line 109, in _get_module_details
__import__(pkg_name)
File "/Users/runner/work/PySR/PySR/pysr/__init__.py", line 3, in <module>
from .sr import (
File "/Users/runner/work/PySR/PySR/pysr/sr.py", line 7, in <module>
import pandas as pd
File "/Users/runner/hostedtoolcache/Python/3.7.17/x64/lib/python3.7/site-packages/pandas/__init__.py", line 50, in <module>
from pandas.core.api import (
File "/Users/runner/hostedtoolcache/Python/3.7.17/x64/lib/python3.7/site-packages/pandas/core/api.py", line 48, in <module>
from pandas.core.groupby import (
File "/Users/runner/hostedtoolcache/Python/3.7.17/x64/lib/python3.7/site-packages/pandas/core/groupby/__init__.py", line 1, in <module>
from pandas.core.groupby.generic import (
File "/Users/runner/hostedtoolcache/Python/3.7.17/x64/lib/python3.7/site-packages/pandas/core/groupby/generic.py", line 73, in <module>
from pandas.core.frame import DataFrame
File "/Users/runner/hostedtoolcache/Python/3.7.17/x64/lib/python3.7/site-packages/pandas/core/frame.py", line 129, in <module>
from pandas.core import (
File "/Users/runner/hostedtoolcache/Python/3.7.17/x64/lib/python3.7/site-packages/pandas/core/generic.py", line 122, in <module>
from pandas.core.describe import describe_ndframe
File "/Users/runner/hostedtoolcache/Python/3.7.17/x64/lib/python3.7/site-packages/pandas/core/describe.py", line 39, in <module>
from pandas.io.formats.format import format_percentiles
File "/Users/runner/hostedtoolcache/Python/3.7.17/x64/lib/python3.7/site-packages/pandas/io/formats/format.py", line 99, in <module>
from pandas.io.common import stringify_path
File "/Users/runner/hostedtoolcache/Python/3.7.17/x64/lib/python3.7/site-packages/pandas/io/common.py", line 4, in <module>
import bz2
File "/Users/runner/hostedtoolcache/Python/3.7.17/x64/lib/python3.7/bz2.py", line 19, in <module>
from _bz2 import BZ2Compressor, BZ2Decompressor
ModuleNotFoundError: No module named '_bz2'
Error: Process completed with exit code 1.
I will submit a PR to fix this shortly.
Expected Behavior
N/A
Installed Versions
N/A
The text was updated successfully, but these errors were encountered:
lithomas1
added
Compat
pandas objects compatability with Numpy or Python functions
IO Data
IO issues that don't fit into a more specific label
and removed
Bug
Needs Triage
Issue that has not been reviewed by a pandas team member
labels
Jun 26, 2023
Pandas version checks
I have checked that this issue has not already been reported.
I have confirmed this bug exists on the latest version of pandas.
I have confirmed this bug exists on the main branch of pandas.
Reproducible Example
Issue Description
On some Python installations, the libbzip2 headers are not compiled into Python. This is also true on some lightweight Python binaries, including (recently) several used by GitHub actions. It does not make much sense for pandas to require
bz2
if one is not doing bzip compression, so I think this import should be safely skipped if not available.You can see several of the GitHub actions for PySR are now failing due to a pandas import: https://github.com/MilesCranmer/PySR/actions/runs/5376798563, despite bzip2 compression never being used in the unittests.
I will submit a PR to fix this shortly.
Expected Behavior
N/A
Installed Versions
N/A
The text was updated successfully, but these errors were encountered: