无法解析ModulenotFoundError

发布于 2025-01-31 05:33:39 字数 417 浏览 2 评论 0原文

我有一个在Python中制作的个人项目,该项目在秋天工作并完成。它使用了两个模块,即“名称”模块和“ pygame”模块。 的情况下没有问题

import names
import pygame

我简单地将代码的顶部放在了我 。我能够很好地运行它,并为我的班级展示该项目。但是,几个月后返回项目后,我发现自己遇到了这样的错误:

ModuleNotFoundError: No module named 'names'

我已经搜索了一段时间,但我似乎没有做任何事情改变了问题。我认为我可能没有下载的模块的任何地方都满足要求,并且卸载和重新安装一无所有。我仍然对Python的来龙去脉相对较新,我知道我可能在PIP(或错误的位置)下载了这些模块或将它们导入错误,但我似乎无法在此处弄清楚我的问题。

I have a personal project made in python that I worked on and completed in the fall. It used two modules, the 'name' module and the 'pygame' module. I had no issues with simply having

import names
import pygame

at the top of my code. I was able to run it just fine and present the project for my class. However, after returning to the project after several months, I have found that I get errors like this:

ModuleNotFoundError: No module named 'names'

I have searched for quite a while and nothing I seem to do changes the issue. Everywhere where I think I might not have the modules downloaded have requirements satisfied, and uninstalling and reinstalling has done nothing. I am still relatively new to the ins and outs of python and I understand that I may have downloaded these modules wrong with pip (or in the wrong spot) or am importing them wrong, but I can't seem to figure out my issue here.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。
列表为空,暂无数据
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文