简体   繁体   English

jupyter notebook已经安装了pattern包为什么导入失败

[英]Why does the pattern package fails to be imported in jupyter notebook yet it is already installed

I installed pattern3 in the cmd with: pip install pattern3我在 cmd 中安装了 pattern3: pip install pattern3

and it was successful I also installed in the jupyter notebook and still it was successful.它是成功的,我也安装在 jupyter notebook 中,它仍然是成功的。 However, when I try to import it with import patterns I get this error:但是,当我尝试使用import patterns导入它时,出现此错误:

---------------------------------------------------------------------------
ModuleNotFoundError                       Traceback (most recent call last)
~\AppData\Local\Temp/ipykernel_2116/1948699844.py in <module>
----> 1 import patterns

ModuleNotFoundError: No module named 'patterns'

I think you have made a typo.我认为你打错了字。 The import statement for the pattern3 module would be import pattern3 , not import patterns . pattern3 模块的 import 语句是import pattern3 ,而不是import patterns

If you have installed the pattern3 module correctly, you should be able to import it by using the new statement.如果您已经正确安装了 pattern3 模块,您应该能够使用 new 语句导入它。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM