How did “people you might know” find you on social software>>>
Run the following code:
if (locals().has_key('data')):
del data
gc.collect()
Error:
if (locals().has_key('data')):
AttributeError: 'dict' object has no attribute 'has_key'
This is because Python 3.6.5 has been deleted_ The key () method is changed to the following writing method:
if 'data' in locals():
del data
gc.collect()
It’s going to work
Similar Posts:
- [How to Solve] ‘dict’ object has no attribute ‘has_key’
- [Solved] Python error: attributeerror: type object ‘STR’ has no attribute ‘_name_’ (machine learning practice treeplotter code)
- AttributeError: ‘module’ object has no attribute ‘main’
- PaddlePaddle Error: ‘map’ object is not subscriptable
- Python PIP upgrade error tips [How to Solve Possible Error]
- Python3.x Error:AttributeError: ‘str’ object has no attribute ‘decode’
- Dill: solve the problem of Python’s “attributeerror: can’t pickle local object” and unable to pickle lambda function
- Problem solved successfully in Python: attributeerror: ‘module’ object has no attribute ‘loadimage‘
- When Django modifies the request attribute: this querydict instance is immutable
- [Solved] Python Error: TypeError: ‘dict_keys’ object does not support indexing