我正在使用 eventlet 模块。当我尝试monkey_patch
代码退出时出现错误:
'__init__ called too many times'
以下是导致问题的代码:
from eventlet import *
patcher.monkey_patch(all=True)
import os, glob, pandas, logging
import numpy as np
import boto3
import datetime
import
工作正常,但monkey
修补是我看到错误的步骤。
编辑:
这是堆栈跟踪:
Traceback (most recent call last):
File "check.py", line 4, in <module>
import os, glob, pandas, logging
File "d:\Python\Anaconda\lib\site-packages\pandas\__init__.py", line 45, in <module>
from pandas.core.api import *
File "d:\Python\Anaconda\lib\site-packages\pandas\core\api.py", line 9, in <module>
from pandas.core.groupby import Grouper
File "d:\Python\Anaconda\lib\site-packages\pandas\core\groupby.py", line 15, in <module>
from pandas.core.frame import DataFrame
File "d:\Python\Anaconda\lib\site-packages\pandas\core\frame.py", line 32, in <module>
from pandas.core.generic import NDFrame, _shared_docs
File "d:\Python\Anaconda\lib\site-packages\pandas\core\generic.py", line 16, in <module>
from pandas.core.internals import BlockManager
File "d:\Python\Anaconda\lib\site-packages\pandas\core\internals.py", line 22, in <module>
from pandas.sparse.array import _maybe_to_sparse, SparseArray
File "d:\Python\Anaconda\lib\site-packages\pandas\sparse\array.py", line 19, in <module>
import pandas.core.ops as ops
File "d:\Python\Anaconda\lib\site-packages\pandas\core\ops.py", line 15, in <module>
import pandas.computation.expressions as expressions
File "d:\Python\Anaconda\lib\site-packages\pandas\computation\expressions.py", line 15, in <module>
import numexpr as ne
File "d:\Python\Anaconda\lib\site-packages\numexpr\__init__.py", line 40, in <module>
from numexpr.expressions import E
File "d:\Python\Anaconda\lib\site-packages\numexpr\expressions.py", line 81, in <module>
_context = Context({})
File "d:\Python\Anaconda\lib\site-packages\numexpr\expressions.py", line 67, in __init__
raise SystemError('__init__ called too many times')
SystemError: __init__ called too many times
答案 0 :(得分:0)
尝试在没有all=True
的情况下运行它:
patcher.monkey_patch()
(你基本上已经多次召集过一次课程)
答案 1 :(得分:0)
特别是Windows机器的问题.. patcher.monkey_patch()在OSX中对我来说非常好,而相同的代码返回 - SystemError: init 为使用wondows机器的同事调用了太多次..
我仍在寻找这个问题的解决方案。