最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

python 3.x - ModuleNotFoundError in Jupyter notebook - Stack Overflow

programmeradmin3浏览0评论

I have tried changing the name of the file multiple times and creating new files to fix this issue but nothing is working in my jupyter notebook.

ModuleNotFoundError                       Traceback (most recent call last)
Input In [4], in <cell line: 21>()
     16 import matplotlib.pyplot as plt
     19 #### FIX ME #####
     20 # change animal_shelter and AnimalShelter to match your CRUD Python module file name and class name
---> 21 from aac import CS340
     25 ###########################
     26 # Data Manipulation / Model
     27 ###########################
     28 # FIX ME update with your username and password and CRUD Python module name. NOTE: You will
     29 # likely need more variables for your constructor to handle the hostname and port of the MongoDB
     30 # server, and the database and collection names
     32 username = "aacuser"

ModuleNotFoundError: No module named 'aac'

How do I fix this or find the correct file name?

I have tried changing the name of the file multiple times and creating new files to fix this issue but nothing is working in my jupyter notebook.

ModuleNotFoundError                       Traceback (most recent call last)
Input In [4], in <cell line: 21>()
     16 import matplotlib.pyplot as plt
     19 #### FIX ME #####
     20 # change animal_shelter and AnimalShelter to match your CRUD Python module file name and class name
---> 21 from aac import CS340
     25 ###########################
     26 # Data Manipulation / Model
     27 ###########################
     28 # FIX ME update with your username and password and CRUD Python module name. NOTE: You will
     29 # likely need more variables for your constructor to handle the hostname and port of the MongoDB
     30 # server, and the database and collection names
     32 username = "aacuser"

ModuleNotFoundError: No module named 'aac'

How do I fix this or find the correct file name?

Share Improve this question asked Feb 17 at 2:44 Rayne989Rayne989 11 bronze badge New contributor Rayne989 is a new contributor to this site. Take care in asking for clarification, commenting, and answering. Check out our Code of Conduct. 1
  • Welcome to Stack Overflow. Please clarify how you installed this module aac. What does it do? – ewokx Commented Feb 17 at 2:55
Add a comment  | 

2 Answers 2

Reset to default 0

1.Ensure the aac Module Exists

project_folder/ aac/ init.py CS340.py main.py

2.Check the Import Statement

from aac.CS340 import SomeClassName
(Replace SomeClassName with the actual class name you're trying to import.)

I think acc is A local library that you wrote yourself, so you need to ensure that acc is in the folder which is jupyternotebook identify the library.

import sys
sys.path.append('/path/to/your/module')
发布评论

评论列表(0)

  1. 暂无评论