![](/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.