[英]How to fix Jupyter notebook dependancies? ModuleNotFoundError: No module named 'boto3'
I am running EMR cluster(AWS) but I do not understand how notebook imports packages.我正在运行 EMR 集群 (AWS),但我不明白笔记本如何导入包。 I am running PySpark kernel.我正在运行 PySpark kernel。
import boto3
No module named 'boto3'
Traceback (most recent call last):
ModuleNotFoundError: No module named 'boto3'
print (sys.version) shows print (sys.version) 显示
3.7.6 (default, Feb 26 2020, 20:54:15)
[GCC 7.3.1 20180712 (Red Hat 7.3.1-6)]
print(sys.executable) shows print(sys.executable) 显示
/tmp/1594625399736-0/bin/python
I have both Conda and pip3 install of boto3.我同时安装了 Conda 和 pip3 的 boto3。
How to solve this?如何解决这个问题?
Are you using pyspark?您使用的是 pyspark 吗? If yes, then you need to install the packages in the spark context.如果是,那么您需要在 spark 上下文中安装这些包。 Refer to this AWS document: https://aws.amazon.com/blogs/big-data/install-python-libraries-on-a-running-cluster-with-emr-notebooks/请参阅此 AWS 文档: https://aws.amazon.com/blogs/big-data/install-python-libraries-on-a-running-cluster-with-emr-notebooks/
similarly install any dependency packages if you see module not found error on import.如果您在导入时看到模块未找到错误,同样安装任何依赖包。 Make sure the versions are compatible.确保版本兼容。
sc.list_packages() sc.list_packages()
Package Version
-------------------------- -------
beautifulsoup4 4.9.0
boto 2.49.0
cycler 0.10.0
jmespath 0.9.5
kiwisolver 1.2.0
lxml 4.5.0
matplotlib 3.2.2
mysqlclient 1.4.2
nltk 3.4.5
nose 1.3.4
numpy 1.19.0
pandas 1.0.5
pip 9.0.1
py-dateutil 2.2
py4j 0.10.9
pyparsing 2.4.7
pyspark 3.0.0
python-dateutil 2.8.1
python37-sagemaker-pyspark 1.3.0
pytz 2020.1
PyYAML 5.3.1
setuptools 28.8.0
six 1.15.0
soupsieve 1.9.5
wheel 0.29.0
windmill 1.6
I have boto.我有博托。
sc.install_pypi_package("boto3") sc.install_pypi_package("boto3")
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.