简体   繁体   English

ModuleNotFoundError:没有名为“numpy”的模块 AWS SageMaker Studio 实验室

[英]ModuleNotFoundError: No module named 'numpy' AWS SageMaker Studio Lab

I installed the numpy with Conda, pip and pip3, also tried installing from the requirements.txt file but I am still getting the following issue.我用 Conda、pip 和 pip3 安装了 numpy,也尝试从 requirements.txt 文件安装,但我仍然遇到以下问题。 Has anyone encountered this before and could please kindly suggest something?有没有人遇到过这个,请提出一些建议?


ModuleNotFoundError Traceback (most recent call last) /tmp/ipykernel_732/1818554654.py in 1 import os ----> 2 import numpy as np 3 import matplotlib.pyplot as plt 4 import pandas as pd 5 import random ModuleNotFoundError Traceback(最近调用最后)/tmp/ipykernel_732/1818554654.py in 1 import os ----> 2 import numpy as np 3 import matplotlib.pyplot as plt 4 import pandas as pd 5 import random

ModuleNotFoundError: No module named 'numpy' ModuleNotFoundError:没有名为“numpy”的模块

numpy is built-in the default:Python environment in Studio Lab. numpy 内置在 Studio Lab 的 default:Python 环境中。 If you open a new notebook with the File -> New -> Notebook, and choose the default:Python kernel, you should be able to import numpy without having to install the package.如果您使用文件 -> 新建 -> 笔记本打开一个新笔记本,并选择default:Python kernel,您应该能够导入 numpy 而无需安装 package。 numpy-default-python-内核

If you would like to have a reproducible environment with a set of packages, see this sample repo on creating custom environments .如果您想拥有一个包含一组包的可重现环境,请参阅有关创建自定义环境的示例存储库

Numpy isn't preinstalled as a module you will need to install it yourself using pip or conda. Numpy 未作为模块预安装,您需要使用 pip 或 conda 自行安装。 Using notebooks just include a code block with the following:使用笔记本只需包含一个代码块,其中包含以下内容:

!python -m pip install numpy

Suggestion to compile a list of required modules in a 'requirements.txt' file and install using:建议在“requirements.txt”文件中编译所需模块的列表并使用以下命令进行安装:

!python -m pip install -r requirements.txt

Just as an FYI, the base package list is as follows:仅供参考,基本 package 列表如下:

Python 3.9 bzip2 build-essential curl git libgl1-mesa-glx nano rsync unzip wget ca-certificates pip ipykernel-6.4 Python 3.9 bzip2 build-essential curl git libgl1-mesa-glx nano rsync unzip wget ca-certificates pip ipykernel-6.4

Have a look at this link for more info.查看此链接以获取更多信息。 SageMaker - Manage your environment SageMaker - 管理您的环境

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 ModuleNotFoundError:没有名为“sagemaker”的模块 - ModuleNotFoundError: No module named 'sagemaker' ModuleNotFoundError:AWS Build 中没有命名的模块 - ModuleNotFoundError: No module named in AWS Build AWS Lambda - Python - ModuleNotFoundError:没有名为“pandas”的模块 - AWS Lambda - Python - ModuleNotFoundError: No module named 'pandas' ModuleNotFoundError:没有名为“application”的模块 [部署 Django 到 AWS] - ModuleNotFoundError: No module named 'application' [Deploying Django to AWS] ModuleNotFoundError:没有名为“psycopg2”的模块 [AWS Glue] - ModuleNotFoundError: No module named 'psycopg2' [AWS Glue] 如何在 SageMaker Studio 实验室中拨打 pip - How to pip in SageMaker Studio Lab AWS beantalk + Django:502 错误网关 - ModuleNotFoundError:没有名为“application”的模块 - AWS beanstalk + Django: 502 Bad Gateway - ModuleNotFoundError: No module named 'application' Sagemaker Studio Lab GPU 不能与 pytorch 一起使用 - Sagemaker Studio Lab GPU not working with pytorch ModuleNotFoundError:没有名为“azure”的模块 - ModuleNotFoundError: No module named 'azure' 没有名为“psycopg2._psycopg”的模块:AWS Lambda 中的 ModuleNotFoundError - No module named 'psycopg2._psycopg': ModuleNotFoundError in AWS Lambda
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM