It is strange to encounter a problem recently in writing a Python script: Thepython script is perfectly fine, but the total error "attributeerror: 'module ' object has no Attribute ' xxx '. This is actually. There is a problem with the PYc file.
Problem Locator:
View The source file of the import library, discover that the source file exists and that there are no errors, and that the source file exists. PYC file
Problem Solving methods:
1. When naming the py script, do not match the python reserved word, module name, etc.
2. Delete the. pyc file for the library (because the. pyc file is generated by the PY script each time it is run; If the code is not updated, the runtime will still walk PYc when the. pyc file is generated, so delete the. pyc file), rerun the code, or find an environment where you can run the code, and copy the. pyc file to replace the
Python script run times error: Attributeerror: ' Module ' object has no attribute * * *