![](/img/trans.png)
[英]ipython recognizes python module, but jupyter notebook does not
[英]Does python "inquirer" module not work with Jupyter Notebook?
我试图提示用户从有限的选项列表中选择一个选项。 我尝试使用inquirer.List()
。 inquirer模块似乎在我的 windows shell 上运行良好,但它不适用于 Jupyter Notebook。 在运行单元格时
questions = [inquirer.List('regression_model', message = 'Select the best Regression Model as per Model Perfomance',
choices = ['Multiple Linear Regression', 'Polynomial Regression', 'Ridge Regression'])]
answers = inquirer.prompt(questions)
Kernel 一直忙,不提示选项。 我认为导入inquirer
有一些问题,所以我也在 Jupyter Notebook 中执行了!pip install inquirer
inquirer 并且它说要求已经满足所以它似乎不是导入问题。
inquirer 不能与 Jupyter Notebook 一起使用吗? 如果不是,我可以使用哪些替代方法从有限的选项列表中提示一个选项?
Inquirer 可能与 Jupyter notebook 冲突,因为它是一个基于命令行的工具。 相反,您实际上可以使用ipywidgets模块。 Ipywidgets 是一个 python 模块,您可以将其导入 jupyter notebook,它提供多个小部件的直接实现,例如下拉菜单、滑动条等。您可以通过查看以下链接找到有关其用法的更多信息。 此外,您可能会为此目的使用DropDown 小部件或动态布局。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.