I want to read one image for the time being before I CNN with keras using my own image.Error message
-------------------------------------------- ------------------------------- ImportError Traceback (most recent call last) <ipython-input-10-40216d0f648d>in<module> 1 import keras 2 from keras.preprocessing.image import array_to_img, img_to_array, load_img ---->3 temp_img = load_img ('RIMG6767.JPG') ~ \ Anaconda3 \ envs \ tensorflow \ lib \ site-packages \ keras_preprocessing \ image.py in load_img (path, grayscale, color_mode, target_size, interpolation) 494 color_mode = 'grayscale' 495 if pil_image is None: ->496 raise ImportError ('Could not import PIL.Image. 497 'The use of `array_to_img` requires PIL.') 498 img = pil_image.open (path) ImportError: Could not import PIL.Image. The use of `array_to_img` requires PIL.</Code></pre> <strong>Applicable source code</strong> <pre><code data-language = "Python">import keras from keras.preprocessing.image import array_to_img, img_to_array, load_img temp_img = load_img ('RIMG6767.JPG')
After confirming that PIL is not installed on the navigator, install Pillow on navigator and succeed.
However, the error has not changed.
Then, when \ Anaconda3 \ envs \ tensorflow \ lib \ site-packages is opened with Explorer, the file of \ PIL and \ Pillow-5.3.0-py3.6.egg-info are confirmed.
I thought PIL wasn't installed ... and opened a terminal
If pip uninstall PIL is typed, it will appear that PIL is not installed.
Just pip uninstal Pillow and uninstall all Pillow.
Download Pillow from the navigator again.
We use Win 10, anaconda navigator to create an environment called tensorflow in addition to root, and work in that environment called tensorflow.
Answer # 1
-no-cache-dir solved it by removing the cache and installing.
- pillow cannot be installed in python virtual environment
- python - importerror module cannot be installed from other packages
- xcode - cropviewcontroller installed with cocoapods cannot be used
- python 3x - installed packages do not apply
- python - importerror: cannot import name'config_context'
- python - when training data is read, the file name becomes ds_store and it cannot be found
- python - i cannot install pyav
- python - cannot get ticker information of oanda api
- python - css cannot be read when debug=false in the environment built with django+https-portal in the docker environment do not
- python 3x - i cannot understand the error message displayed by the jupyter notebook in the process of face recognition using dee
- python - i'm getting an error that render_to_response cannot be imported by django
- python 3x - cannot display png file
- python 3x - matplotlib cannot be imported
- python - cannot execute selenium on web (cgi)
- python 3x - regarding the fact that the seaborn graph cannot be drawn properly
- i installed python, but can't run it
- python 3x - python, selenium, radio button cannot be selected
- cuda cannot be installed
- python - cannot move files to /opt
- python - error that cannot reshape
- python 3x - unable to install python38 pip requirementstxt
- python - i have a question about pip
- python - i want to know how to eliminate no module named'flask'
- python - i want to create a shortcut in a specific folder
- python - unicodedecodeerror when installing pip on windows
- i have python and pip installed on windows, but i can't install using pip
- regarding arguments for superclass constructors in python tkinter
- error occurs in getelement method of htmlobject obtained from win32comclient in python37
- python 3x - unclear code in tkinter (python) written in object-oriented
- python 3x - is it possible to get "specific value selected event" in tkinter combo box in python?