![](/img/trans.png)
[英]I have installed lightgbm successfully but can't run in jupyter
[英]How can I test that I have a Python module successfully installed?
我试图安装beautifulsoup。 我收到这样的错误:
<-片段->
raise MissingSectionHeaderError(fpname, lineno, line)
ConfigParser.MissingSectionHeaderError: File contains no section headers.
file: /Users/Sam/.pydistutils.cfg, line: 1
'install_lib = ~/Library/Python/$py_version_short/site-packages\n'
我在vim中运行Python代码时遇到类似的错误::!python%
您可以像这样测试是否安装了模块:
$ python
>>> import modulename
我会尝试以下方法:
import <moduleName>
您需要更复杂的东西吗?
尝试:从prettytable导入PrettyTable除外:尝试:打印“ \\ 033 [31mPython-prettytable模块[不可用] \\ 033 [0m”] os.system('sudo apt-get install python-setuptools')os.system('sudo easy_install prettyTable')打印“ \\ 033 [33mPython-prettytable模块[已安装] \\ 033 [0m””,但:打印“ PrettyTable Python模块安装失败。” 打印“ \\ 033 [32mPython-prettytable模块[可用] \\ 033 [0m”
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.