Python script run times error: Attributeerror: ' Module ' object has no attribute * * *

Source: Internet
Author: User
Tags python script

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 * * *

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.