首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >使用SCOOP时的Exception和TypeError

使用SCOOP时的Exception和TypeError
EN

Stack Overflow用户
提问于 2021-08-12 07:48:07
回答 1查看 27关注 0票数 0

我想在高性能计算环境中使用SCOOP (Python语言中的可伸缩COncurrent操作)。为了测试独家新闻,我在我的Windows机器上使用Python 2.7.18在Anaconda环境(4.10.3)中安装了模块。从the docs运行此示例脚本时

代码语言:javascript
复制
# -*- coding: utf-8 -*-

from __future__ import print_function
from scoop import futures

def helloWorld(value):
    return "Hello World from Future #{0}".format(value)

if __name__ == "__main__":
    returnValues = list(futures.map(helloWorld, range(16)))
    print("\n".join(returnValues))

我在控制台中得到了以下输出。

代码语言:javascript
复制
(scoop) C:\Users\flyinthelotion\Downloads>python -m scoop -n 6 test_scoop.py
[2021-08-12 09:39:35,285] launcher  INFO    SCOOP 0.7 1.1 on win32 using Python 2.7.18 |Anaconda, Inc.| (default, Apr 23 2020, 17:26:54) [MSC v.1500 64 bit (AMD64)], API: 1013
[2021-08-12 09:39:35,285] launcher  INFO    Deploying 6 worker(s) over 1 host(s).
[2021-08-12 09:39:35,286] launcher  INFO    Worker distribution:
[2021-08-12 09:39:35,286] launcher  INFO       127.0.0.1:       5 + origin
Hello World from Future #0
Hello World from Future #1
Hello World from Future #2
Hello World from Future #3
Hello World from Future #4
Hello World from Future #5
Hello World from Future #6
Hello World from Future #7
Hello World from Future #8
Hello World from Future #9
Hello World from Future #10
Hello World from Future #11
Hello World from Future #12
Hello World from Future #13
Hello World from Future #14
Hello World from Future #15
Exception Exception TypeErrorTypeError: : ""''NNoonneeTTyyppee''  oobbjjeecctt  iiss  nnException ooTypeErrortt:   "cc'aaNllollnaaebbTllyeep""e in  in '<< bound method Socket.__del__ of <zmq.sugar.socket.Socket object at 0x0000000004141C18>>bound method Socket.__del__ of <zmq.sugar.socket.Socket object at 0x0000000003DB2C18>>o ignored
Exception Exception bTypeErrorTypeError ignored
j: : Exception e""TypeErrorc: ''t"NN 'ooiNnnsoee nTTneyyoTpptyee p''ce  a'ool bblojjebaecjbctelt ce it"is  in s i< nsbound method Socket.__del__ of <zmq.sugar.socket.Socket object at 0x0000000003882C18>>no  ignored
ntoException o tTypeErrortc :  ac"cla'allNlalolbanalbelebTe"ly" in ep in <"e<bound method Socket.__del__ of <zmq.sugar.socket.Socket object at 0x0000000003492C18>> in 'bound method Socket.__del__ of <zmq.sugar.socket.Socket object at 0x0000000004141F28>> ignored
Exception Exception <  ignored
Exception TypeErrorTypeErrorbound method Socket.__del__ of <zmq.sugar.socket.Socket object at 0x0000000003DB2F28>>oException TypeError: :  ignored
bTypeError: ""Exception j: "''TypeErrore"'NN: c'NNo"tooon' nnneNieeeTosTTTyn yyypenpppeToee'yte'' p '  oec 'obaoo bjlbbojeljjbecaeejctbccet lttc ie  tis"ii s  in ssi n<  snobound method Socket.__del__ of <zmq.sugar.socket.Socket object at 0x0000000003882F28>>nn ot ignored
oont Exception tto cTypeError  tca: cc al"aacll'llalaNlllaboaalblnbbaleellbe"Teel" in y""e in <p in  in "<bound method Socket.__del__ of <zmq.sugar.socket.Socket object at 0x0000000003365C18>>e<< in bound method Socket.__del__ of <zmq.sugar.socket.Socket object at 0x0000000003492F28>> ignored
'bound method Socket.__del__ of <zmq.sugar.socket.Socket object at 0x0000000003945C18>>bound method Socket.__del__ of <zmq.sugar.socket.Socket object at 0x0000000004141F98>>< ignored
Exception   ignored
 ignored
bound method Socket.__del__ of <zmq.sugar.socket.Socket object at 0x0000000003DB2F98>>Exception TypeErroroException  ignored
TypeError: bTypeError: "j: "'e"'Nc'NotNon oneineTseTy Typnyepop'ete ' 'o c boaojblbejljceaetcbc tlti e si"i s in sn < ontnbound method Socket.__del__ of <zmq.sugar.socket.Socket object at 0x0000000003882F98>>o o ignored
tct a clcalalallb[lal2021-08-12 09:39:37,559] launcher  (127.0.0.1:51026) INFO    Root process is done.
abebl"l in ee<"[2021-08-12 09:39:37,561] launcher  (127.0.0.1:51026) INFO    Finished cleaning spawned subprocesses.

因此: SCOOP做了需要做的事情,但同时也抛出了错误。不过,这些错误似乎不会对其性能产生影响。这对我未来的项目是一个问题吗?我如何避免显示这些错误?

谢谢

EN

回答 1

Stack Overflow用户

回答已采纳

发布于 2021-08-12 07:54:51

忽略异常的消息是因为忽略了__del__方法中引发的所有异常,以保持数据模型正常。docs

如果你想便宜地修复它,就试着抓住错误

票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/68753509

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档