天天看點

jupyter notebook 安裝報錯ImportError: DLL load failed while importing win32api: 找不到指定的子產品。

問題描述:

  有兩個python 虛拟環境,一個python 2.7, 一個python 3.8。先在2.7中安裝了jupyter,可以正常運作。再在3.8中安裝,出現下面的報錯:

[I 17:31:49.462 NotebookApp] Creating new notebook in /note/pandas_plt
   [E 17:31:51.577 NotebookApp] Uncaught exception POST /api/sessions (127.0.0.1)
   HTTPServerRequest(protocol='http', host='localhost:8888', method='POST', uri='/api/sessions', version='HTTP/1.1', remote_ip='127.0.0.1')
   Traceback (most recent call last):
     File "d:\work\envpy\lib\site-packages\tornado\web.py", line 1704, in _execute
   ··· ···
           return next(self.gen)
     File "d:\work\envpy\lib\site-packages\jupyter_core\paths.py", line 461, in secure_write
       win32_restrict_file_to_user(fname)
     File "d:\work\envpy\lib\site-packages\jupyter_core\paths.py", line 387, in win32_restrict_file_to_user
       import win32api
   ImportError: DLL load failed while importing win32api: 找不到指定的子產品。   
           

處理方式:

在對應的python虛拟環境檔案中找到

pywin32_postinstall.py

檔案,在

{虛拟環境路徑}\Scripts

目錄下。執行指令:

python pywin32_postinstall.py -install

繼續閱讀