简体   繁体   English

如何修复 Jupyter notebook 依赖项? ModuleNotFoundError:没有名为“boto3”的模块

[英]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.

相关问题 通过 Boto3 创建 session 给出错误 - ModuleNotFoundError: No module named 'multiprocessing.managers'; “多处理”不是 package - creating session via Boto3 is giving error - ModuleNotFoundError: No module named 'multiprocessing.managers'; 'multiprocessing' is not a package 如何在 AWS 上修复 Django“ModuleNotFoundError:没有名为‘application’的模块”? - How to fix Django "ModuleNotFoundError: No module named 'application'" on AWS? 已安装 boto3 但出现 ModuleNotFoundError - boto3 installed yet getting ModuleNotFoundError ModuleNotFoundError:没有名为“pystan”的模块 - ModuleNotFoundError: No module named 'pystan' 如何修复 boto3 aws botocore.exceptions.NoCredentialsError: - How to fix boto3 aws botocore.exceptions.NoCredentialsError: ModuleNotFoundError:没有名为“sagemaker”的模块 - ModuleNotFoundError: No module named 'sagemaker' ModuleNotFoundError:没有名为“azure”的模块 - ModuleNotFoundError: No module named 'azure' ModuleNotFoundError:AWS Build 中没有命名的模块 - ModuleNotFoundError: No module named in AWS Build 如何使用 boto3 将嵌套字典插入 dynamodb? - how to insert a nested dict to dynamodb with boto3? 如何配置与boto3内联的授权机制 - How to configure authorization mechanism inline with boto3
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM