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()