Skip to content

pandas does not import with cpython master #32766

Closed
@tacaswell

Description

@tacaswell

Code Sample, a copy-pastable example if possible

# Your code here
import pandas

Problem description

jupiter@21:38  ➤  ipython                                                                                                                                                                                                                                                       
Python 3.9.0a4+ (heads/master:87ec86c425, Mar 16 2020, 11:05:13) 
Type 'copyright', 'credits' or 'license' for more information
IPython 8.0.0.dev -- An enhanced Interactive Python. Type '?' for help.

In [1]: import pandas                                                                                                                                                                                                                                                           
---------------------------------------------------------------------------
AttributeError                            Traceback (most recent call last)
<ipython-input-1-38d4b0363d82> in <module>
----> 1 import pandas

~/.virtualenvs/bleeding/lib/python3.9/site-packages/pandas/__init__.py in <module>
    120 from pandas.tseries.api import infer_freq
    121 from pandas.tseries import offsets
--> 123 from pandas.core.computation.api import eval
    125 from pandas.core.reshape.api import (
    126     concat,
    127     lreshape,
   (...)
    138     qcut,
    139 )
    141 import pandas.api

~/.virtualenvs/bleeding/lib/python3.9/site-packages/pandas/core/computation/api.py in <module>
      1 # flake8: noqa
----> 3 from pandas.core.computation.eval import eval

~/.virtualenvs/bleeding/lib/python3.9/site-packages/pandas/core/computation/eval.py in <module>
     11 from pandas.util._validators import validate_bool_kwarg
     13 from pandas.core.computation.engines import _engines
---> 14 from pandas.core.computation.expr import Expr, _parsers
     15 from pandas.core.computation.parsing import tokenize_string
     16 from pandas.core.computation.scope import ensure_scope

~/.virtualenvs/bleeding/lib/python3.9/site-packages/pandas/core/computation/expr.py in <module>
    188 _expr_nodes = _filter_nodes(ast.expr)
    189 _expr_context_nodes = _filter_nodes(ast.expr_context)
--> 190 _slice_nodes = _filter_nodes(ast.slice)
    191 _boolop_nodes = _filter_nodes(ast.boolop)
    192 _operator_nodes = _filter_nodes(ast.operator)

AttributeError: module 'ast' has no attribute 'slice'

In [2]:   
jupiter@21:41  ➤  git describe                                                                                      
v1.1.0.dev0-846-g7aa3dd274     

It looks like this is due to python/cpython#9605 / https://bugs.python.org/issue34822 and needs to be sorted for py39

Metadata

Metadata

Assignees

No one assigned

    Labels

    BugCompatpandas objects compatability with Numpy or Python functions

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions