久久久久久久av_日韩在线中文_看一级毛片视频_日本精品二区_成人深夜福利视频_武道仙尊动漫在线观看

  • <i id='gMHmq'><tr id='gMHmq'><dt id='gMHmq'><q id='gMHmq'><span id='gMHmq'><b id='gMHmq'><form id='gMHmq'><ins id='gMHmq'></ins><ul id='gMHmq'></ul><sub id='gMHmq'></sub></form><legend id='gMHmq'></legend><bdo id='gMHmq'><pre id='gMHmq'><center id='gMHmq'></center></pre></bdo></b><th id='gMHmq'></th></span></q></dt></tr></i><div class="qwawimqqmiuu" id='gMHmq'><tfoot id='gMHmq'></tfoot><dl id='gMHmq'><fieldset id='gMHmq'></fieldset></dl></div>
    • <bdo id='gMHmq'></bdo><ul id='gMHmq'></ul>
  • <legend id='gMHmq'><style id='gMHmq'><dir id='gMHmq'><q id='gMHmq'></q></dir></style></legend>

      <small id='gMHmq'></small><noframes id='gMHmq'>

      <tfoot id='gMHmq'></tfoot>

        Python多處理錯誤:AttributeError:模塊'__main__'沒

        Python Multiprocessing error: AttributeError: module #39;__main__#39; has no attribute #39;__spec__#39;(Python多處理錯誤:AttributeError:模塊__main__沒有屬性__spec__)
      1. <tfoot id='hUzV2'></tfoot>
          <bdo id='hUzV2'></bdo><ul id='hUzV2'></ul>

            <tbody id='hUzV2'></tbody>
          <legend id='hUzV2'><style id='hUzV2'><dir id='hUzV2'><q id='hUzV2'></q></dir></style></legend>
        • <i id='hUzV2'><tr id='hUzV2'><dt id='hUzV2'><q id='hUzV2'><span id='hUzV2'><b id='hUzV2'><form id='hUzV2'><ins id='hUzV2'></ins><ul id='hUzV2'></ul><sub id='hUzV2'></sub></form><legend id='hUzV2'></legend><bdo id='hUzV2'><pre id='hUzV2'><center id='hUzV2'></center></pre></bdo></b><th id='hUzV2'></th></span></q></dt></tr></i><div class="qwawimqqmiuu" id='hUzV2'><tfoot id='hUzV2'></tfoot><dl id='hUzV2'><fieldset id='hUzV2'></fieldset></dl></div>

            <small id='hUzV2'></small><noframes id='hUzV2'>

                  本文介紹了Python多處理錯誤:AttributeError:模塊'__main__'沒有屬性'__spec__'的處理方法,對大家解決問題具有一定的參考價值,需要的朋友們下面隨著小編來一起學習吧!

                  問題描述

                  限時送ChatGPT賬號..

                  我正在使用 Python 3.6,并嘗試遵循下面網站上的第一個示例(完整代碼也在下面)并且收到以下錯誤:https://docs.python.org/3.6/library/multiprocessing.html

                  I'm using Python 3.6 and am trying to follow along with the very first example at the website below (full code also below) and am getting the below error: https://docs.python.org/3.6/library/multiprocessing.html

                  錯誤信息:AttributeError: 模塊 '__main__' 沒有屬性 '__spec__'

                  完整示例代碼:

                  from multiprocessing import Pool
                  
                  def f(x):
                      return x*x
                  
                  if __name__ == '__main__':
                      with Pool(5) as p:
                          print(p.map(f, [1, 2, 3]))
                  

                  我嘗試用谷歌搜索它并搜索 Stack Overflow,但我只發現了另一種這種錯誤的情況,它沒有答案.

                  I tried Googling it and searching Stack Overflow but I've only found one other case of this error and it did not have an answer.

                  推薦答案

                  問題不在于代碼/Python 3.6,而在于 Spyder.

                  The problem is not with the code / Python 3.6, it is with Spyder.

                  經過一番調查,我發現代碼在外部系統終端中執行時運行良好,但在 Spyder 的 IPython 控制臺中運行時卻不行.

                  After some investigation I found that the code runs fine when executed in an external system terminal but not when run in Spyder's IPython console.

                  我能夠轉儲 spec 的內容并將它們分配給包含在 ma??in 中的變量,以允許此代碼在 IPython 控制臺中運行.

                  I was able to dump the contents of spec and assign them to a variable that was included inside main to allow this code to function within the IPython console.

                  from multiprocessing import Pool
                  
                  def f(x):
                      return x*x
                  
                  if __name__ == '__main__':
                      __spec__ = "ModuleSpec(name='builtins', loader=<class '_frozen_importlib.BuiltinImporter'>)"
                      with Pool(5) as p:
                         print (p.map(f, [1, 2, 3]))
                  

                  這篇關于Python多處理錯誤:AttributeError:模塊'__main__'沒有屬性'__spec__'的文章就介紹到這了,希望我們推薦的答案對大家有所幫助,也希望大家多多支持html5模板網!

                  【網站聲明】本站部分內容來源于互聯網,旨在幫助大家更快的解決問題,如果有圖片或者內容侵犯了您的權益,請聯系我們刪除處理,感謝您的支持!

                  相關文檔推薦

                  What exactly is Python multiprocessing Module#39;s .join() Method Doing?(Python 多處理模塊的 .join() 方法到底在做什么?)
                  Passing multiple parameters to pool.map() function in Python(在 Python 中將多個參數傳遞給 pool.map() 函數)
                  multiprocessing.pool.MaybeEncodingError: #39;TypeError(quot;cannot serialize #39;_io.BufferedReader#39; objectquot;,)#39;(multiprocessing.pool.MaybeEncodingError: TypeError(cannot serialize _io.BufferedReader object,)) - IT屋-程序員軟件開
                  Python Multiprocess Pool. How to exit the script when one of the worker process determines no more work needs to be done?(Python 多進程池.當其中一個工作進程確定不再需要完成工作時,如何退出腳本?) - IT屋-程序員
                  How do you pass a Queue reference to a function managed by pool.map_async()?(如何將隊列引用傳遞給 pool.map_async() 管理的函數?)
                  yet another confusion with multiprocessing error, #39;module#39; object has no attribute #39;f#39;(與多處理錯誤的另一個混淆,“模塊對象沒有屬性“f)

                        <bdo id='exnUM'></bdo><ul id='exnUM'></ul>
                        <i id='exnUM'><tr id='exnUM'><dt id='exnUM'><q id='exnUM'><span id='exnUM'><b id='exnUM'><form id='exnUM'><ins id='exnUM'></ins><ul id='exnUM'></ul><sub id='exnUM'></sub></form><legend id='exnUM'></legend><bdo id='exnUM'><pre id='exnUM'><center id='exnUM'></center></pre></bdo></b><th id='exnUM'></th></span></q></dt></tr></i><div class="qwawimqqmiuu" id='exnUM'><tfoot id='exnUM'></tfoot><dl id='exnUM'><fieldset id='exnUM'></fieldset></dl></div>
                        <tfoot id='exnUM'></tfoot>
                      • <legend id='exnUM'><style id='exnUM'><dir id='exnUM'><q id='exnUM'></q></dir></style></legend>
                              <tbody id='exnUM'></tbody>

                            <small id='exnUM'></small><noframes id='exnUM'>

                            主站蜘蛛池模板: 影音av| 中文字幕一级毛片 | 性视频一区 | 午夜精品视频 | 色爱综合网 | 国产精品九九九 | 国产精品成人一区二区三区 | 亚洲综合99 | 亚洲一级黄色 | 久久免费视频在线 | 国户精品久久久久久久久久久不卡 | 欧美日韩成人在线观看 | 国产一区二区在线播放 | 久久国产精品久久 | 国产视频第一页 | 国产目拍亚洲精品99久久精品 | 国产精品国产三级国产aⅴ无密码 | 91精品国产一区二区三区 | 亚洲成人免费在线观看 | 精品乱码久久久久 | aaaa一级毛片 | 免费黄色片在线观看 | 国产免费福利小视频 | 亚洲一区二区三区高清 | 国产成年人视频 | 99re视频在线观看 | 欧美一级二级视频 | 国产区在线观看 | 男人亚洲天堂 | 国产成人免费视频网站视频社区 | 日韩精品一区在线 | 精品一二区 | 91福利在线导航 | 欧美大片黄| 天天操 天天操 | 久久在视频 | 欧美日韩在线一区二区 | 国产精品久久一区二区三区 | 欧美精品一二三 | 国产欧美日韩一区二区三区在线观看 | 91精品国产一区二区三区 |