I find that the file directly uses requests. Get (URL) to prompt me for attributeerror: module ‘requests’ has no attribute’ get ‘
The solution is as follows:
The python source file has the same name as the keyword
1. When naming py script, do not use the same reserved word and module name as python
2. Delete the. PyC file of the library (because the. PyC file is generated every time the PY script runs; When the. PyC file has been generated, if the code is not updated, the runtime will still run PyC, so delete the. PyC file and rerun the code; Or find an environment that can run the code, copy and replace the. PyC file of the current machine
Later, I found that there is a program with a requests.py file in my path. If I delete it, I won’t report this kind of error
Similar Posts:
- ImportError: No module named ‘requests’
- [Solved] requests.exceptions.InvalidSchema: No connection adapters were found for
- Python 2.7 and 3.4 requests Error: No module named ‘zlib’
- When running Python script, an error is reported: a true sslcontext object is not available
- C# call Python error no module named OS [How to Solve]
- [Solved] No module named extern.six.moves
- [Solved] Python request Error: requests.exceptions.ReadTimeout: HTTPSConnectionPool (xxxx)
- Bpython ImportError: No module named _curses [How to Solve]
- The solution of ‘STR’ object has no attribute ‘get’ error
- python requests [Errno 104] Connection reset by peer