请稍等 ...
×

采纳答案成功!

向帮助你的同学说点啥吧!感谢那些助人为乐的人

.cnblogs 模拟登录时出现几个错误

Chrome : 版本 96.0.4664.45(正式版本) (64 位)
操作系统 : Windows 10 64 bit [10.0.19042]
python : Python 3.9.4

在 .cnblogs 模拟登录时出现如下几个错误:

  1. raise RuntimeError(’’'
    RuntimeError:
    An attempt has been made to start a new process before the
    current process has finished its bootstrapping phase.

     This probably means that you are not using fork to start your
     child processes and you have forgotten to use the proper idiom
     in the main module:
    
         if __name__ == '__main__':
             freeze_support()
             ...
    
     The "freeze_support()" line can be omitted if the program
     is not going to be frozen to produce an executable.
    
  2. AttributeError: ‘Chrome’ object has no attribute ‘service’

上网查询答案无法解决,请求大家帮助,谢谢!

正在回答

2回答

我刚刚网上搜到答案,在main页中加入这句话“if __name__ == '__main__':”,就没出现了

0 回复 有任何疑惑可以回复我~
  • 提问者 红萼 #1
    修改之后程序确实可以正常运行了,十分感谢!!
    回复 有任何疑惑可以回复我~ 2021-12-01 20:47:57
  • bobby 回复 提问者 红萼 #2
    这个是windows的坑。在linux下没有,我好像在其他课程中讲到过这个坑
    回复 有任何疑惑可以回复我~ 2021-12-03 09:37:47
  • 魈仔 #3
    不知道改在那个文件中添加if __name__ == '__main__',小白求解答
    回复 有任何疑惑可以回复我~ 2021-12-19 16:20:06
慕神2158989 2021-12-01 01:14:36

我也是同样的问题

0 回复 有任何疑惑可以回复我~
问题已解决,确定采纳
还有疑问,暂不采纳
微信客服

购课补贴
联系客服咨询优惠详情

帮助反馈 APP下载

慕课网APP
您的移动学习伙伴

公众号

扫描二维码
关注慕课网微信公众号