Python代码在Jupyter笔记本上运行,但不在命令行上运行

2024-09-30 02:25:11 发布

您现在位置:Python中文网/ 问答频道 /正文

我已经使用Jupyter笔记本编写了python代码,它将自动更新电子表格。现在我正在尝试使用一个.bat文件来运行它,我计划使用Windows任务调度器每月运行一次。但是,当我尝试运行bat文件时,它会显示以下错误:

C:\Users\sdoggett\Box\Clipper Monthly Report Automation\Automation Code>"C:\ProgramData\Anaconda3\python.exe" "C:\Users\sdoggett\Box\Clipper Monthly Report Automation\Automation Code\Scheduled_Spreadsheet_Automation.py"
Traceback (most recent call last):
  File "C:\Users\sdoggett\Box\Clipper Monthly Report Automation\Automation Code\Scheduled_Spreadsheet_Automation.py", line 10, in <module>
    import Spreadsheet_Automation as SA
  File "C:\Users\sdoggett\Box\Clipper Monthly Report Automation\Automation Code\Spreadsheet_Automation.py", line 20, in <module>
    import numpy as np
  File "C:\ProgramData\Anaconda3\lib\site-packages\numpy\__init__.py", line 140, in <module>
    from . import _distributor_init
  File "C:\ProgramData\Anaconda3\lib\site-packages\numpy\_distributor_init.py", line 34, in <module>
    from . import _mklinit
ImportError: DLL load failed: The specified module could not be found.

问题不在我的代码中,因为它在Juypter笔记本中运行。我可以毫无问题地导入其他python包,因此具体来说NumPy可能有问题。你知道吗

我不是一个专家编码,所以我会感谢任何解决方案的详细解释。你知道吗


Tags: inpyimportreportboxlinecodeusers

热门问题