ImportError:没有名为log的模块

时间:2016-08-02 17:42:01

标签: python

是不是在python中记录内置包?

# /usr/bin/python
Python 2.7.5 (default, Oct 11 2015, 17:47:16) 
[GCC 4.8.3 20140911 (Red Hat 4.8.3-9)] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import log as logging
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
ImportError: No module named log
>>> 

我是否需要使用pip安装log

1 个答案:

答案 0 :(得分:2)

loggingbuilt-in package,而不是log

import logging as log