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

Unhandled exception: module 'pandas' has no attribute 'tslib' #97

Open
amotl opened this issue Aug 7, 2022 · 7 comments
Open

Unhandled exception: module 'pandas' has no attribute 'tslib' #97

amotl opened this issue Aug 7, 2022 · 7 comments
Labels

Comments

@amotl
Copy link
Member

amotl commented Aug 7, 2022

@amotl amotl added the bug label Aug 7, 2022
@amotl
Copy link
Member Author

amotl commented Jun 8, 2023

kotori@elbanco:~$ /opt/kotori/bin/python
Python 3.9.2 (default, Feb 28 2021, 17:03:44)
[GCC 10.2.1 20210110] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import pandas
>>> pandas.__version__
'1.2.5'

@amotl
Copy link
Member Author

amotl commented Jun 8, 2023

It looks like yhat/ggpy#662 (comment) summarizes the solution.

The correct way should be:

  • Change pandas.tslib.Timestamp to pandas.Timestamp.
  • Change from pandas.lib import Timestamp to from pandas import Timestamp.

@amotl
Copy link
Member Author

amotl commented Jun 8, 2023

kotori@elbanco:~$ /opt/kotori/bin/python
Python 3.9.2 (default, Feb 28 2021, 17:03:44)
[GCC 10.2.1 20210110] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import ggplot
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/opt/kotori/lib/python3.9/site-packages/ggplot/__init__.py", line 19, in <module>
    from .geoms import geom_area, geom_blank, geom_boxplot, geom_line, geom_point, geom_jitter, geom_histogram, geom_density, geom_hline, geom_vline, geom_bar, geom_abline, geom_tile, geom_rect, geom_bin2d, geom_step, geom_text, geom_path, geom_ribbon, geom_now_its_art, geom_violin, geom_errorbar, geom_polygon
  File "/opt/kotori/lib/python3.9/site-packages/ggplot/geoms/__init__.py", line 1, in <module>
    from .geom_abline import geom_abline
  File "/opt/kotori/lib/python3.9/site-packages/ggplot/geoms/geom_abline.py", line 1, in <module>
    from .geom import geom
  File "/opt/kotori/lib/python3.9/site-packages/ggplot/geoms/geom.py", line 3, in <module>
    from ..ggplot import ggplot
  File "/opt/kotori/lib/python3.9/site-packages/ggplot/ggplot.py", line 13, in <module>
    from .aes import aes
  File "/opt/kotori/lib/python3.9/site-packages/ggplot/aes.py", line 11, in <module>
    from . import utils
  File "/opt/kotori/lib/python3.9/site-packages/ggplot/utils.py", line 81, in <module>
    pd.tslib.Timestamp,
  File "/opt/kotori/lib/python3.9/site-packages/pandas/__init__.py", line 244, in __getattr__
    raise AttributeError(f"module 'pandas' has no attribute '{name}'")
AttributeError: module 'pandas' has no attribute 'tslib'
kotori@elbanco:~$ cat /opt/kotori/lib/python3.9/site-packages/ggplot/__init__.py | grep version
__version__ = '0.11.5'

@amotl
Copy link
Member Author

amotl commented Jun 8, 2023

It looks like there is no newer release of ggplot available. The most recent one is 0.11.5, released on Sep 29, 2016.

-- https://pypi.org/project/ggplot/

@amotl
Copy link
Member Author

amotl commented Jun 8, 2023

At yhat/ggpy#662 (comment), @AAAlex-123 suggests to pip install plotnine. Maybe it is a drop-in replacement / successor package?

-- https://pypi.org/project/plotnine/

@amotl
Copy link
Member Author

amotl commented Jun 9, 2023

We fixed it on behalf of GH-147.

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

No branches or pull requests

1 participant