0
votes

When I import pandas library in python 3 it gave me a error.

Traceback (most recent call last): File "C:\Users\KESHAV SHARMA\Desktop\VS Code\Compiler\as.py", line 1, in import pandas as pd File "C:\Users\KESHAV SHARMA\AppData\Roaming\Python\Python38\site-packages\pandas__init__.py", line 124, in from pandas.core.computation.api import eval File "C:\Users\KESHAV SHARMA\AppData\Roaming\Python\Python38\site-packages\pandas\core\computation\api.py", line 3, in from pandas.core.computation.eval import eval File "C:\Users\KESHAV SHARMA\AppData\Roaming\Python\Python38\site-packages\pandas\core\computation\eval.py", line 15, in from pandas.core.computation.expr import Expr, _parsers File "C:\Users\KESHAV SHARMA\AppData\Roaming\Python\Python38\site-packages\pandas\core\computation\expr.py", line 158, in _all_nodes = frozenset( File "C:\Users\KESHAV SHARMA\AppData\Roaming\Python\Python38\site-packages\pandas\core\computation\expr.py", line 160, in lambda x: isinstance(x, type) and issubclass(x, ast.AST), AttributeError: module 'ast' has no attribute 'AST'


Please help me to sort out this problem.
1

1 Answers

0
votes

Try using only ast instead of ast.AST

 lambda x: isinstance(x, type) and issubclass(x, ast)