为什么我的脚本在从命令行运行时出错,而在从spyder控制台运行时却不出错

2024-06-25 07:03:16 发布

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

我的脚本是一个简单的网络垃圾脚本。它使用硒和熊猫从一个叫zacks的地方刮食。当我从spider控制台运行它时,它工作正常。当我从命令行(使用windows任务调度器或手动)启动它时,它会给出一个完整的错误列表:

   [1004/134642.349:INFO:CONSOLE(6)] "🚀 container.buildInfo.environment is deprecated.Please use `container.environment.stage` instead", source: https://assets.adobedtm.com/launch-ENf92a8a0f57b7412a8d05119401e8c329.min.js (6)
    [1004/134642.349:INFO:CONSOLE(6)] "🚀 container.buildInfo.environment is deprecated.Please use `container.environment.stage` instead", source: https://assets.adobedtm.com/launch-ENf92a8a0f57b7412a8d05119401e8c329.min.js (6)
    [1004/134642.431:INFO:CONSOLE(6)] "Failed to execute 'write' on 'Document': It isn't possible to write into a document from an asynchronously-loaded external script unless it is explicitly opened.", source: https://securepubads.g.doubleclick.net/tag/js/gpt.js (6)
    [1004/134642.718:INFO:CONSOLE(11)] "[GPT] Div ID passed to googletag.display() does not match any defined slots: Leaderboard-mobile_103.", source: https://securepubads.g.doubleclick.net/gpt/pubads_impl_2021092201.js?31062997 (11)
    [1004/134642.720:INFO:CONSOLE(11)] "[GPT] Div ID passed to googletag.display() does not match any defined slots: Leaderboard-bottom_102.", source: https://securepubads.g.doubleclick.net/gpt/pubads_impl_2021092201.js?31062997 (11)
    JOBLOG zstats YUM  Scraping Comp Overview failed
    lxml not found, please install it
    JOBLOG zstats YUM  db insert comp overview failed
    local variable 'dfcompoverview' referenced before assignment
    JOBLOG zstats YUM  Scraping Fin Values failed
    lxml not found, please install it

起初我认为命令行python可能是一个不同的环境。但是你看,我只有一个环境。我试图重新安装pandas并安装不同版本的pandas来解决lxml错误,但没有成功。由于其他的错误,我甚至不知道从哪里开始

有人有这个问题吗


Tags: tohttpsinfosourcenetenvironmentiscontainer