ModulenotFoundError:No模块名为' pandas'

发布于 2025-02-12 21:41:44 字数 1350 浏览 0 评论 0原文

在本地/虚拟环境中安装大熊猫后,我仍然遇到这个问题。

我的项目试图从网站上刮擦一些数据。它的当前结构是

project/
  website/
    __init__.py
    __main__.py: The CLI for running the merger directly.
    helperfunc.py: The file where all the global functions are.
    merger.py: The file containing the class declaration and definition for merger.
    dataframe.py

我遇到错误,

File "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/runpy.py", line 185, in _run_module_as_main
    mod_name, mod_spec, code = _get_module_details(mod_name, _Error)
  File "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/runpy.py", line 144, in _get_module_details
    return _get_module_details(pkg_main_name, error)
  File "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/runpy.py", line 111, in _get_module_details
    __import__(pkg_name)
File "/Users/Project-main/project/website/__init__.py", line 1, in <module>
    from .dataframe import *
  File "/Users/Project-main/Project/website/dataframe.py", line 1, in <module>
    from pandas import DataFrame
ModuleNotFoundError: No module named 'pandas'

我100%确定我已经安装了pandas,因此我想就此错误提供任何建议。同时,我还使用了Click和Office365模块,这些模块也安装在诗歌中。但是,它仍然显示导入的“模块”也无法解析辅助错误。如果它与上面提到的错误有关,我就不会。

我的怀疑是,由于该项目会将数据刮给OneDrive,而凭证当前已经过时,这可能导致脚本执行失败?

I have still run into this issue after installing pandas in my local/virtual environment.

My project is trying to scrape some data from a website. Its current structure is

project/
  website/
    __init__.py
    __main__.py: The CLI for running the merger directly.
    helperfunc.py: The file where all the global functions are.
    merger.py: The file containing the class declaration and definition for merger.
    dataframe.py

I encounter the error

File "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/runpy.py", line 185, in _run_module_as_main
    mod_name, mod_spec, code = _get_module_details(mod_name, _Error)
  File "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/runpy.py", line 144, in _get_module_details
    return _get_module_details(pkg_main_name, error)
  File "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/runpy.py", line 111, in _get_module_details
    __import__(pkg_name)
File "/Users/Project-main/project/website/__init__.py", line 1, in <module>
    from .dataframe import *
  File "/Users/Project-main/Project/website/dataframe.py", line 1, in <module>
    from pandas import DataFrame
ModuleNotFoundError: No module named 'pandas'

I am 100% certain I have installed pandas so I would like for any advice on this error. At the same time, I have also use click and office365 module which I have also installed in poetry. However it still shows a Import "module" could not be resolvedPylance error as well. I don't if it is related to my error mentioned above.

My suspicion is that since this project will scrape data to onedrive which the credentials is currently outdated which may lead to the fail execution of the script?

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

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

发布评论

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