jupyter中匯入gensim錯誤

2021-10-17 14:10:36 字數 408 閱讀 4540

錯誤原因:cannot import name 'open' from 'smart_open' 

根本原因在於:各個模組之間版本不相容,呼叫出現錯誤

更新smart_open版本無效,之後檢視smart_open資料夾下utils.py和smart_open_lib.py

在smart_open_lib.py中需要返回open檔案:

return open(**locals())
而在utils.py中需要呼叫open檔案,所以只需在smart_open資料夾下建立open.py檔案,將這兩個檔案聯絡起來。在open.py檔案中新增**段:

from .smart_open_lib import *
之後可以正常呼叫gensim庫

jupyter無法匯入tensorflow

環境 我在ubuntu系統下安裝的anaconda3,然後並在裡面使用env安裝的tensorflow,之前安裝的jupyter notebook並不是在我的tensorflow環境下安裝的,所以你無法引入tensorflow。這是我在安裝之前的展示的jupyter的結果 很顯然,我的jupyter...

python中匯入模組

在程式開發的過程中,隨著 量越來越大,我們可以把完成某個功能的函式進行分組,放在乙個.py檔案裡邊,這樣的乙個.py檔案稱為乙個module,這樣做最大的好處就是提高 的可重用性和可維護性,新的開發可以呼叫原來模組的函式,我們經常用的python內建模組和第三方類庫就屬於module。簡單來說,乙個...

ORACLE中匯入匯出總結

下面介紹的是匯入匯出的例項。資料匯出 1 將資料庫test完全匯出,使用者名稱system 密碼manager 匯出到d daochu.dmp中 exp system manager test file d daochu.dmp full y 2 將資料庫中system使用者與sys使用者的表匯出 ...