Skip to content

Version conflict of py-pandas and py-openpyxl #818

@climbfuji

Description

@climbfuji

Describe the bug
This error pops up in one of the JCSDA applications when using spack-stack-1.5.0 (not a problem with earlier versions):

Traceback (most recent call last):
  File "/Users/heinzell/work/github-admin/github-admin-develop/github_api/./commit_summary.py", line 489, in <module>
    main()
  File "/Users/heinzell/prod/spack-stack-1.5.0/envs/unified-env/install/apple-clang/13.1.6/py-click-8.0.3-edxrx3v/lib/python3.10/site-packages/click/core.py", line 1128, in __call__
    return self.main(*args, **kwargs)
  File "/Users/heinzell/prod/spack-stack-1.5.0/envs/unified-env/install/apple-clang/13.1.6/py-click-8.0.3-edxrx3v/lib/python3.10/site-packages/click/core.py", line 1053, in main
    rv = self.invoke(ctx)
  File "/Users/heinzell/prod/spack-stack-1.5.0/envs/unified-env/install/apple-clang/13.1.6/py-click-8.0.3-edxrx3v/lib/python3.10/site-packages/click/core.py", line 1395, in invoke
    return ctx.invoke(self.callback, **ctx.params)
  File "/Users/heinzell/prod/spack-stack-1.5.0/envs/unified-env/install/apple-clang/13.1.6/py-click-8.0.3-edxrx3v/lib/python3.10/site-packages/click/core.py", line 754, in invoke
    return __callback(*args, **kwargs)
  File "/Users/heinzell/work/github-admin/github-admin-develop/github_api/./commit_summary.py", line 159, in main
    summary_output(df_all, xml)
  File "/Users/heinzell/work/github-admin/github-admin-develop/github_api/./commit_summary.py", line 435, in summary_output
    df_contrib = pd.read_excel(fuser, sheet_name='ALL', index_col=None, engine="openpyxl")
  File "/Users/heinzell/prod/spack-stack-1.5.0/envs/unified-env/install/apple-clang/13.1.6/py-pandas-1.5.3-jnyekmt/lib/python3.10/site-packages/pandas/util/_decorators.py", line 211, in wrapper
    return func(*args, **kwargs)
  File "/Users/heinzell/prod/spack-stack-1.5.0/envs/unified-env/install/apple-clang/13.1.6/py-pandas-1.5.3-jnyekmt/lib/python3.10/site-packages/pandas/util/_decorators.py", line 331, in wrapper
    return func(*args, **kwargs)
  File "/Users/heinzell/prod/spack-stack-1.5.0/envs/unified-env/install/apple-clang/13.1.6/py-pandas-1.5.3-jnyekmt/lib/python3.10/site-packages/pandas/io/excel/_base.py", line 482, in read_excel
    io = ExcelFile(io, storage_options=storage_options, engine=engine)
  File "/Users/heinzell/prod/spack-stack-1.5.0/envs/unified-env/install/apple-clang/13.1.6/py-pandas-1.5.3-jnyekmt/lib/python3.10/site-packages/pandas/io/excel/_base.py", line 1695, in __init__
    self._reader = self._engines[engine](self._io, storage_options=storage_options)
  File "/Users/heinzell/prod/spack-stack-1.5.0/envs/unified-env/install/apple-clang/13.1.6/py-pandas-1.5.3-jnyekmt/lib/python3.10/site-packages/pandas/io/excel/_openpyxl.py", line 556, in __init__
    import_optional_dependency("openpyxl")
  File "/Users/heinzell/prod/spack-stack-1.5.0/envs/unified-env/install/apple-clang/13.1.6/py-pandas-1.5.3-jnyekmt/lib/python3.10/site-packages/pandas/compat/_optional.py", line 171, in import_optional_dependency
    raise ImportError(msg)
ImportError: Pandas requires version '3.0.7' or newer of 'openpyxl' (version '3.0.3' currently installed).

The versions in spack-stack-1.5.0 are: py-pandas@1.5.3 (not sure how this relates to the 3.0.7 version reported above) and py-openpyxl@3.0.3

To Reproduce
Reproducer:

#!/usr/bin/env python3

import pandas as pd
from pathlib import Path

user_file = "AOP2023 Q2 GitHub usernames.xlsx"
fuser = Path('input/'+user_file)
df_contrib = pd.read_excel(fuser, sheet_name='ALL', index_col=None, engine="openpyxl")

Expected behavior
Correct version dependencies of Python packages py-pandas and py-openpyxl

System:
macOS with python@3.10.8

Additional context
n/a

Metadata

Metadata

Assignees

Labels

INFRAJEDI InfrastructurebugSomething is not working

Type

No type

Projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions