2
votes

I got this error message in Spyder,

import pandas as pd

Traceback (most recent call last):

File "", line 1, in import pandas as pd

File "C:\ProgramData\Anaconda3\lib\site-packages\pandas__init__.py", line 42, in from pandas.core.api import *

File "C:\ProgramData\Anaconda3\lib\site-packages\pandas\core\api.py", line 7, in from pandas.core.algorithms import factorize, unique, value_counts

File "C:\ProgramData\Anaconda3\lib\site-packages\pandas\core\algorithms.py", line 10, in from pandas.core.dtypes.cast import maybe_promote

ImportError: cannot import name 'maybe_promote'

However if I use cmd, it goes well without any problem. Please suggest a way to fix this problem

1

1 Answers

0
votes

Check in your Anaconda Prompt if you've installed pandas within an Anaconda environment. In that case, you need to launch the spyder after activating that particular environment. Let's say, the pandas is installed within an environment named 'myenv', then type the following two commands in your Anaconda prompt:

activate myenv
spyder