AttributeError: module ‘PIL. Image’ has no attribute ‘open’. It means PIL.image does not has an open method. I have searched lots of solutions online, but they are not work. Finally, I inadvertently saw the address of image.py (c:\users\lenovo\pycharmprojects\kk\venv\lib\site packages\pil\image.py). I know the reason of the error.
from PIL import Image
import os
import csv
import time
Reason: the image.py file under the PIL package was accidentally emptied, so image.open() cannot be realized.
temp_img_now = Image.open(temp_file)
Solution: uninstall the pilot and pillow-PIL, and then reinstall them.
Read More:
- Importerror: DLL load failed: unable to find the specified module in Python
- [How to Solve]AttributeError: module ‘scipy’ has no attribute ‘io’
- How to Solve Termux install Pillow Error
- AttributeError: module ‘time‘ has no attribute ‘clock‘ [How to Solve]
- RuntimeWarning: overflow encountered in ubyte_Scalars pixel addition and subtraction overflow exception
- [Solved] Paramiko error: AttributeError: ‘NoneType’ object has no attribute ‘time’
- [Solved] Pdfplumber Read PDF Sheet Error: AttributeError: function/symbol ‘ARC4_stream_init‘ not found in library
- PIP Install Mysqlclient error C1083: Cannot open include file: ‘mysql.h‘: No such file or directory
- [Solved] AttributeError: module ‘logging‘ has no attribute ‘Handler‘
- Install PyTorch in Anaconda environment
- [Mac Pro M1] Python3.9 import cv2 Error: Reason: image not found
- How to Solve Python ImportError: cannot import name UnrewindableBodyError
- Python writes DICOM file (attributeerror: ‘filemetadataset’ object has no attribute ‘transfersyntax uid’ solution)
- Python 3.7 Error: AttributeError: ‘str‘ object has no attribute ‘decode‘ [How to Solve]
- [Solved] AttributeError: module ‘setuptools._distutils‘ has no attribute ‘version‘
- [Solved] Python Image Library fails with message “decoder JPEG not available” – PIL
- Python Error: OSError: cannot open resource [How to Solve]
- [Solved] Python Error: AttributeError: partially initialized module ‘keyword‘ has no attribute ‘kwlist‘
- pytest pluggy.manager.PluginValidationError: unknown hook’pytest_namespace’ error handling method
- [Solved] modulenotfounderror: no module named ‘torchtext.legacy.data.datasets_ utils‘