ImportError: cannot import name 'remove_na'

Hi There,

I installed pandas and seabor as below,
sudo apt-get install python3-pandas
sudo apt-get install python3-seaborn

but still get below error when run my python script, could someone help me out?

$ python3 -c “import seaborn as sn”
Traceback (most recent call last):
File “”, line 1, in
File “/usr/lib/python3/dist-packages/seaborn/init.py”, line 10, in
from .categorical import *
File “/usr/lib/python3/dist-packages/seaborn/categorical.py”, line 7, in
from pandas.core.series import remove_na
ImportError: cannot import name ‘remove_na’

Thanks,
Bin

Hi,

Have you tried to install it with pip3?
If not, would you mind giving it a try?

Thanks.

Thanks for the feedback. pip3 failed to install seabon, that’s why I use apt install .

Hi @larryyang1, it would seem that this issue is related to this post:

On a fresh install of JetPack 4.6.1 (actually in the l4t-base:r32.7.1 container, but same thing really), I’m able to install python3-pandas and python3-seaborn from apt and then run import seaborn without issue.

So perhaps it’s that when you tried to install from pip3, the pandas that pip3 installed is newer and is still being used, and there is some version mismatch between what the python3-seaborn apt package expects. Have you tried completely uninstalling pandas through pip3 and apt?