from odps import ODPS
instatnce = odps.execute_sql('select * from dual')
with instatnce.open_reader(tunnel=True) as reader:
df = reader.to_pandas()
print(df)
会报以下错误:
Traceback (most recent call last):
File "C:/Users/yangh/PycharmProjects/fenxiang_project/auto_excute_sql.py", line 23, in
df = reader.to_pandas()
File "C:\Users\yangh\anaconda3\lib\site-packages\odps\models\instance.py", line 854, in to_pandas
_mp_context = multiprocessing.get_context('fork')
File "C:\Users\yangh\anaconda3\lib\multiprocessing\context.py", line 239, in get_context
return super().get_context(method)
File "C:\Users\yangh\anaconda3\lib\multiprocessing\context.py", line 193, in get_context
raise ValueError('cannot find context for %r' % method) from None
ValueError: cannot find context for 'fork'
当你在win10下执行以下代码:
会报以下错误:
临时解决方案:
改成
原代码位置: