问题描述
我有一个从tensrflow和Jupyter(Python 3内核)映像运行的Docker容器:erroneousboat/tensorflow-python3-jupyter
I have a Docker container running from tensrflow with Jupyter (Python 3 Kernel) image: erroneousboat/tensorflow-python3-jupyter
这很好用,我可以从
http://DOCKER_IP:8888
我唯一的问题是未安装pandas库.因此,我尝试自行安装.我打开了docker quickstart终端并运行:
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
安装成功,但是当我尝试在jupyter笔记本中导入熊猫时,仍然收到ImportError:没有名为"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
仍然,在我的Jupyter笔记本中,熊猫未被识别.我怎样才能解决这个问题?谢谢!
Still, in my jupyter notebook, pandas is not recognized. How can I fix this? Thank you!
推荐答案
pip install pandas
将为您安装最新版本的熊猫.
pip install pandas
will install the latest version of pandas for you.
根据标签python-3.x
,我假设pip
属于您的Python3版本,如果您安装了多个python版本,请确保您具有正确的pip.
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.
这篇关于没有名为'pandas'的模块-Jupyter,Python3内核,通过Docker的Tenserflow的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!