久久久久久久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'>

                            主站蜘蛛池模板: 成人做爰69片免费 | 少妇高潮av久久久久久 | www.huangse| 国产乱码一区二区三区 | 欧美顶级黄色大片免费 | 一级黄色片免费看 | 在线观看黄色av | av在线视| 欧美在线观看一区二区 | 欧美一级黄色大片 | 国产午夜精品视频 | 久久av一区二区三区亚洲 | 国产精品一区二区三 | 欧美日批视频 | 国产精品国产三级国产 | 高跟肉丝丝袜呻吟啪啪网站av | 一级黄色录相 | 欧美性猛交xx | 午夜一级片 | 亚洲激情欧美激情 | 中文在线字幕观看 | 中文在线字幕观看 | 中文在线字幕观看 | 免费国产黄色 | 毛片在线免费 | 亚洲精品久久久久avwww潮水 | 中文字幕在线观看第一页 | 在线黄色av| 国产精品视频久久久 | 一级片免费网站 | 三级福利视频 | 日韩三级久久 | 伊人激情网 | 91久久国产综合久久91精品网站 | 免费一区二区 | 成年免费视频黄网站在线观看 | 麻豆一级片 | 欧美三级三级三级爽爽爽 | 香蕉伊人网 | 国产一区二区免费看 | 在线看的av |