質問編集履歴
1
コード追加
test
CHANGED
File without changes
|
test
CHANGED
@@ -1,6 +1,12 @@
|
|
1
1
|
以下のコードでつまづいてしまいました。どこが間違っているのかご指摘いただけると助かります。
|
2
2
|
|
3
3
|
よろしくお願い致します。
|
4
|
+
|
5
|
+
|
6
|
+
|
7
|
+
**実行エディターjupyterlab**
|
8
|
+
|
9
|
+
|
4
10
|
|
5
11
|
```
|
6
12
|
|
@@ -99,3 +105,85 @@
|
|
99
105
|
コード
|
100
106
|
|
101
107
|
```
|
108
|
+
|
109
|
+
|
110
|
+
|
111
|
+
**追記**
|
112
|
+
|
113
|
+
①
|
114
|
+
|
115
|
+
```
|
116
|
+
|
117
|
+
from PIL import Image
|
118
|
+
|
119
|
+
import io
|
120
|
+
|
121
|
+
↓
|
122
|
+
|
123
|
+
img1 = Image.open(io.BytesIO(requests.get(img_url).content))
|
124
|
+
|
125
|
+
↓error
|
126
|
+
|
127
|
+
----------------------------------------------------------------------
|
128
|
+
|
129
|
+
NameError Traceback (most recent call last)
|
130
|
+
|
131
|
+
<ipython-input-30-3c912c4d98ab> in <module>
|
132
|
+
|
133
|
+
----> 1 img1= Image.open(io.BytesIO(requests.get(img_url).content))
|
134
|
+
|
135
|
+
|
136
|
+
|
137
|
+
NameError: name 'img_url' is not defined
|
138
|
+
|
139
|
+
```
|
140
|
+
|
141
|
+
②
|
142
|
+
|
143
|
+
```
|
144
|
+
|
145
|
+
from PIL import Image
|
146
|
+
|
147
|
+
from StringIO import StringIO
|
148
|
+
|
149
|
+
i = Image.open(StringIO(r.content))
|
150
|
+
|
151
|
+
↓error
|
152
|
+
|
153
|
+
----------------------------------------------------------------------
|
154
|
+
|
155
|
+
ModuleNotFoundError Traceback (most recent call last)
|
156
|
+
|
157
|
+
<ipython-input-28-02a980174e24> in <module>
|
158
|
+
|
159
|
+
1 from PIL import Image
|
160
|
+
|
161
|
+
----> 2 from StringIO import StringIO
|
162
|
+
|
163
|
+
3 i = Image.open(StringIO(r.content))
|
164
|
+
|
165
|
+
|
166
|
+
|
167
|
+
ModuleNotFoundError: No module named 'StringIO'
|
168
|
+
|
169
|
+
↓
|
170
|
+
|
171
|
+
img1= Image.open(io.BytesIO(requests.get(img_url).content))
|
172
|
+
|
173
|
+
↓error
|
174
|
+
|
175
|
+
----------------------------------------------------------------------
|
176
|
+
|
177
|
+
NameError Traceback (most recent call last)
|
178
|
+
|
179
|
+
<ipython-input-30-3c912c4d98ab> in <module>
|
180
|
+
|
181
|
+
----> 1 img1= Image.open(io.BytesIO(requests.get(img_url).content))
|
182
|
+
|
183
|
+
|
184
|
+
|
185
|
+
NameError: name 'img_url' is not defined
|
186
|
+
|
187
|
+
|
188
|
+
|
189
|
+
```
|