unable to import pandas - python

I installed some backtesting libraries which updated pandas version.
Since then I'm getting ImportError: cannot import name 'hashtable'
I referred the existing question: Hashtable Error in Pandas.
And tried
> pip install pandas
> conda update pandas
but nothing seems working. Any suggestions are welcome.
EDIT :
I removed pandas from conda using conda remove --force pandas
And reinstalled it.
Now I'm getting new error
AttributeError: module 'pandas' has no attribute 'compat'
Thanks

I removed pandas from lib/site-packages and reinstalled pandas using
pip install pandas. It worked.

Related

Jupyter Lab issue regarding pandas and plotly initial import

Hey there I am relatively new to python. I have a hw assignment and it requires me to use an initial import of (import plotly.express as px). When I run the code it returns to me this (module 'pandas' has no attribute 'Panel'). I am using jupyter lab and I have been told that it has a lot of issues with plotly. I have also tried using jupyter notebook but still the same error. Some of my download versions include:
Python-dotenv : 0.16.0
Python : 3.7.9
Nb_conda : 2.2.1
Nodejs : 14.8.0
Npm : 6.14.7
Holoviz : 0.11.3
Plotly : 4.14.3
Pandas : 1.2.4
Please let me know if you have any solutions to this problem. Thanks
As the Pandas' documentation states, the Panel attribute has been deprecated since version 0.20.0. You are using a version of Pandas (1.2.4) which does not have this attribute anymore. In other words, your code is too old for the version of Pandas in Jupyter Lab.
To solve this, you should follow the documentation and update the code to use either an xarray or a MultiIndex as a replacement to Panel.
Alternatively, a quick and dirty to solve this specific issue is to install a downgraded version of Pandas, but you'll probably have to downgrade a lot of other packages too. So I cannot recommend this option. Anyway, you can do this by adding a cell with this command, before the import and then restarting your notebook environment:
!pip install pandas==0.19.2
I've been struggling with plotly.express and pandas in jupyter notebook as well.
I've recently upgraded pandas to 1.3.0 and plolty to 5.1.0.
I had the same error, make sure you upgrade all dependencies as well along with pandas and plotly.
For me this command in the console did the trick:
pip install xarray --upgrade

ImportError: cannot import name 'doc' from 'pandas.util._decorators' (C:\ProgramData\Anaconda3\lib\site-packages\pandas\util\_decorators.py)

I am trying to import pycaret but this error holds me back.
How do I solve this?
ImportError
I get this error when importing fbprophet. Actually this error happens when you import any package that contains pandas.
I'm trying to downgrade pandas but conda says my packages are in conflict.Probably need to reinstall anaconda to solve this.

Getting AttributeError: module 'pandas' has no attribute 'json_normalize' while calling method "Access OutbreakLocation data"

I am exploring the Jupiter notebook for Python. While calling this method "Access OutbreakLocation data" I get this exception in Python 3.6:
getting AttributeError: module 'pandas' has no attribute 'json_normalize'
Any ideas how can we fix this issue?
I too had this error, the solution is load pandas of the following way:
from pandas.io.json import json_normalize
This is due to version change of the pandas library.
Make sure to update to Pandas 1.0.3. Pandas prior to version 1 doesn't have json_normalize.
!pip install --user pandas==1.0.3
import pandas as pd
pd.__version__
ibm studio was running a pandas version 0.24.
By using above commands it was upgraded to version 1.0.3

i have done "!pip install pandas" but Jupyter still dont find it

i first use jupyter notebook.
i tried to run
import pandas as pd
but it returns
No module called pandas
i've tried
!pip install pandas
it run successlfully
jupyter show installing process
but after pandas installed, it still return
No module called pandas
when i run
import pandas as pd
why ? and how to fix it
You probably have multiple pythons installed. See instructions here

Getting ImportError on spyder when trying to open a DataFrame after updating pandas and numpy

I was trying to run some commands that needed me to update pandas, and then numpy, and so I did. Problem is now, when I try to look into a DataFrame in the variable explorer, they don't open and I get this error instead:
ImportError: No module named 'pandas.core.internals.managers'; 'pandas.core.internals' is not a package
Do you know what is happening?
I had the same problem. I solved it installing the pandas version 0.24.2
pip install pandas==0.24.2

Categories