'module' object has no attribute 'basicConfig'


I have the following code, copied from the Python manual:

import logging
LOG_FILENAME = 'example.log'
logging.basicConfig(filename=LOG_FILENAME,level=logging.DEBUG)

logging.debug('This message should go to the log file')

解决办法:

You've got another module called logging on the python path; probably a file logging.py in the same directory. Compare print logging.__file__.

http://stackoverflow.com/questions/4482587/module-object-has-no-attribute-basicconfig
Traceback (most recent call last): File "<stdin>", line 1, in <module> File "/data/data/com.termux/files/usr/lib/python3.12/site-packages/akshare/__init__.py", line 4642, in <module> from akshare.stock_feature.stock_a_pe_and_pb import ( File "/data/data/com.termux/files/usr/lib/python3.12/site-packages/akshare/stock_feature/stock_a_pe_and_pb.py", line 320, in <module> js_functions = py_mini_racer.MiniRacer() ^^^^^^^^^^^^^^^^^^^^^^^^^ File "/data/data/com.termux/files/usr/lib/python3.12/site-packages/py_mini_racer/py_mini_racer.py", line 185, in __init__ self.__class__.ext = _build_ext_handle() ^^^^^^^^^^^^^^^^^^^ File "/data/data/com.termux/files/usr/lib/python3.12/site-packages/py_mini_racer/py_mini_racer.py", line 134, in _build_ext_handle _ext_handle = ctypes.CDLL(EXTENSION_PATH) ^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/data/data/com.termux/files/usr/lib/python3.12/ctypes/__init__.py", line 379, in __init__ self._handle = _dlopen(self._name, mode) ^^^^^^^^^^^^^^^^^^^^^^^^^ OSError: dlopen failed: library "libpthread.so.0" not found: needed by /data/data/com.termux/files/usr/lib/python3.12/site-packages/py_mini_racer/armlibmini_racer.glibc.so in namespace (default) >>> data = ak.stock_zh_a_hist(symbol="000001", period="daily") Exception ignored in: <function MiniRacer.__del__ at 0x71789ea5c0> Traceback (most recent call last): File "/data/data/com.termux/files/usr/lib/python3.12/site-packages/py_mini_racer/py_mini_racer.py", line 322, in __del__ self.ext.mr_free_context(getattr(self, "ctx", None)) ^^^^^^^^^^^^^^^^^^^^^^^^ AttributeError: 'NoneType' object has no attribute 'mr_free_context' Traceback (most recent call last): File "<stdin>", line 1, in <module> NameError: name 'ak' is not defined >>> print(data.head())
最新发布
03-16
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值