No module named 'pandas' - Jupyter, Python

2019-07-18 22:55发布

I have a Docker container running from tensrflow with Jupyter (Python 3 Kernel) image: erroneousboat/tensorflow-python3-jupyter

This works great and I can access the jupyter notebook from

http://DOCKER_IP:8888

My only issue is that pandas library is not installed. So, I tried to install it on my own. I opened up the docker quickstart terminal and ran:

docker exec CONTAINER_ID apt-get update
docker exec CONTAINER_ID apt-get install -y python3-pandas

The installation succeeds, and yet I still get the ImportError: No module named 'pandas' when I try to import pandas in the jupyter notebook, like so:

import pandas as pd

I also tried installing pandas to the image rather than just my container by:

docker run -it erroneousboat/tensorflow-python3-jupyter /bin/bash
apt-get update
apt-get install -y python3-pandas
exit

Still, in my jupyter notebook, pandas is not recognized. How can I fix this? Thank you!

1条回答
Summer. ? 凉城
2楼-- · 2019-07-18 23:28

pip install pandas will install the latest version of pandas for you.

Based on your tags python-3.x, I assumed pip belongs to your Python3 version, if you have multiple python versions installed, make sure you have the correct pip.

查看更多
登录 后发表回答