运行pyLDAvis.gensim.prepare()时报错,请问如何解决

运行vis= pyLDAvis.gensim.prepare(ldamodel,corpus,dictionary)时报错,报错如下:

---------------------------------------------------------------------------

Traceback (most recent call last):<br />   File "<string>", line 1, in <module><br /> <strong>ModuleNotFoundError: No module named 'joblib'</strong><br /> Traceback (most recent call last):<br />   File "C:\Users\Pying\Downloads\Untitled11.py", line 144, in <module><br />     lda_vis()<br />   File "C:\Users\Pying\Downloads\Untitled11.py", line 138, in lda_vis<br />     vis = pyLDAvis.gensim.prepare(ldamodel,corpus,dictionary)<br />   File "D:\lib\site-packages\pyLDAvis\gensim.py", line 119, in prepare<br />     return vis_prepare(**opts)<br />   File "D:\lib\site-packages\pyLDAvis\_prepare.py", line 398, in prepare<br />     topic_info         = _topic_info(topic_term_dists, topic_proportion, term_frequency, term_topic_freq, vocab, lambda_step, R, n_jobs)<br />   File "D:\lib\site-packages\pyLDAvis\_prepare.py", line 255, in _topic_info<br />     for ls in _job_chunks(lambda_seq, n_jobs)))<br />   File "D:\lib\site-packages\joblib\parallel.py", line 1029, in __call__<br />     if self.dispatch_one_batch(iterator):<br />   File "D:\lib\site-packages\joblib\parallel.py", line 847, in dispatch_one_batch<br />     self._dispatch(tasks)<br />   File "D:\lib\site-packages\joblib\parallel.py", line 765, in _dispatch<br />     job = self._backend.apply_async(batch, callback=cb)<br />   File "D:\lib\site-packages\joblib\_parallel_backends.py", line 531, in apply_async<br />     future = self._workers.submit(SafeFunction(func))<br />   File "D:\lib\site-packages\joblib\externals\loky\reusable_executor.py", line 178, in submit<br />     fn, *args, **kwargs)<br />   File "D:\lib\site-packages\joblib\externals\loky\process_executor.py", line 1122, in submit<br />     self._ensure_executor_running()<br />   File "D:\lib\site-packages\joblib\externals\loky\process_executor.py", line 1096, in _ensure_executor_running<br />     self._adjust_process_count()<br />   File "D:\lib\site-packages\joblib\externals\loky\process_executor.py", line 1087, in _adjust_process_count<br />     p.start()<br />   File "D:\lib\multiprocessing\process.py", line 112, in start<br />     self._popen = self._Popen(self)<br />   File "D:\lib\site-packages\joblib\externals\loky\backend\process.py", line 39, in _Popen<br />     return Popen(process_obj)<br />   File "D:\lib\site-packages\joblib\externals\loky\backend\popen_loky_win32.py", line 55, in __init__<br />     process_obj._name, getattr(process_obj, "init_main_module", True))<br />   File "D:\lib\site-packages\joblib\externals\loky\backend\spawn.py", line 86, in get_preparation_data<br />     _resource_tracker.ensure_running()<br />   File "D:\lib\site-packages\joblib\externals\loky\backend\resource_tracker.py", line 102, in ensure_running<br />     if self._check_alive():<br />   File "D:\lib\site-packages\joblib\externals\loky\backend\resource_tracker.py", line 182, in _check_alive<br />     self._send('PROBE', '', '')<br />   File "D:\lib\site-packages\joblib\externals\loky\backend\resource_tracker.py", line 209, in _send<br />     nbytes = os.write(self._fd, msg)<br /> <strong>OSError: [Errno 22] Invalid argument</strong><br /> D:\lib\site-packages\joblib\_memmapping_reducer.py:608: UserWarning: Failed to delete temporary folder: C:\Users\Pying\AppData\Local\Temp\joblib_memmapping_folder_2268_9b443fb54f15476a8c4a2606b0ce72c0_6bec5e64801946b6b8ddc4e1feb0e183<br />   .format(pool_subfolder))<br /> D:\lib\site-packages\joblib\_memmapping_reducer.py:608: UserWarning: Failed to delete temporary folder: C:\Users\Pying\AppData\Local\Temp\joblib_memmapping_folder_2268_9b443fb54f15476a8c4a2606b0ce72c0_5842a46560b54f02bd32911c70f6af64<br />   .format(pool_subfolder))

提示没有安装joblib,在cmd命令行,通过pip install joblib安装一下即可。

您好,我是问答小助手,你的问题已经有小伙伴为您解答了问题,您看下是否解决了您的问题,可以追评进行沟通哦~

如果有您比较满意的答案 / 帮您提供解决思路的答案,可以点击【采纳】按钮,给回答的小伙伴一些鼓励哦~~