1. 程式人生 > 其它 >python 多機分佈 錯誤提示:During handling of the above exception, another exception occurred: 解決方法

python 多機分佈 錯誤提示:During handling of the above exception, another exception occurred: 解決方法

During handling of the above exception, another exception occurred:

處理方法:

cmd:netstat -ano
找到被佔用的埠,找右邊對應的PID 5062
tasklist|findstr "5062"
顯示對應的程序名稱:pythow.exe
開啟工作管理員,關閉相應的程序即可

if __name__=='__main__':
    freeze_support()
    print('start!')
    #global connect,con
    connect = pymysql.connect(user = '
O', password = 'h', db = 'xi', host = 'r', port = 3306, charset = 'utf8' ) con = connect.cursor() QueueManager.register('get_task_queue', callable=return_task_queue) QueueManager.register('get_result_queue
', callable=return_result_queue) # 繫結埠5000, 設定驗證碼'abc': #manager = QueueManager(address=('', 5000), authkey=b'abc') # windows需要寫ip地址 manager = QueueManager(address=('192.168.1.254', 5006), authkey=b'abc') manager.start() # 啟動Queue: # 獲得通過網路訪問的Queue物件: task = manager.get_task_queue() result
= manager.get_result_queue()