プログラミング初心者です。
Pillowを利用して画像を表示させたいのですが画像を置いたディレクトリが認識されません。
C:\Users\the maker>python
Python 3.6.1 (v3.6.1:69c0db5, Mar 21 2017, 18:41:36) [MSC v.1900 64 bit (AMD64)] on win32
Type "help", "copyright", "credits" or "license" for more information.
from PIL import Image
image = Image.open('Pillow_folder/Irohasu.jpg')
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "C:\Users\the maker\AppData\Local\Programs\Python\Python36\lib\site-packages\PIL\Image.py", line 2312, in open
fp = builtins.open(filename, "rb")
FileNotFoundError: [Errno 2] No such file or directory: 'Pillow_folder/Irohasu.jpg'
また、コマンドプロンプト上でpythonを経由せずpipを使うのを試してみたのですが、fromが認識されません。
C:\Users\the maker>pip install Pillow
Requirement already satisfied: Pillow in c:\users\the maker\appdata\local\programs\python\python36\lib\site-packages
Requirement already satisfied: olefile in c:\users\the maker\appdata\local\programs\python\python36\lib\site-packages (from Pillow)
C:\Users\the maker>from PIL import Image
'from' は、内部コマンドまたは外部コマンド、
操作可能なプログラムまたはバッチ ファイルとして認識されていません。
バッドをするには、ログインかつ
こちらの条件を満たす必要があります。
退会済みユーザー
2017/03/30 21:57
退会済みユーザー
2017/03/30 21:58
2017/03/31 00:15 編集