質問編集履歴

3

言語名、ライブラリの追加

2020/08/18 04:54

投稿

netz-eng
netz-eng

スコア105

test CHANGED
File without changes
test CHANGED
@@ -276,7 +276,7 @@
276
276
 
277
277
  「lzw_decodeがインポートできませんでした」と言われたため、sample.exeの元となるsample.py内で、
278
278
 
279
- ```ここに言語を入力
279
+ ```python
280
280
 
281
281
  from imagecodecs import lzw_decode
282
282
 
@@ -379,3 +379,5 @@
379
379
  tifffile 2020.8.13
380
380
 
381
381
  PyInstaller 4.0
382
+
383
+ imagecodecs 2020.5.30

2

追記

2020/08/18 04:54

投稿

netz-eng
netz-eng

スコア105

test CHANGED
File without changes
test CHANGED
@@ -262,6 +262,110 @@
262
262
 
263
263
 
264
264
 
265
+ ### 追記・試したこととエラー変更
266
+
267
+ 「imagecodecsがありません」と言われているのはなんとなく分かったため、imagecodecsライブラリをインストールしてみました。
268
+
269
+ すると、エラー内容が下のようになりました。エラー箇所は恐らく同じです。
270
+
271
+ ```python
272
+
273
+ DelayedImportError: could not import name 'lzw_decode' from 'imagecodecs'
274
+
275
+ ```
276
+
277
+ 「lzw_decodeがインポートできませんでした」と言われたため、sample.exeの元となるsample.py内で、
278
+
279
+ ```ここに言語を入力
280
+
281
+ from imagecodecs import lzw_decode
282
+
283
+ ```
284
+
285
+ のコードを追加し、再度PyInstallerで.exe化しました。すると、エラーの内容が以下に変わりました。
286
+
287
+ ```python
288
+
289
+ Traceback (most recent call last):
290
+
291
+ File "sample.py", line 286, in storedata
292
+
293
+ File "tifffile\tifffile.py", line 712, in imread
294
+
295
+ File "tifffile\tifffile.py", line 2651, in asarray
296
+
297
+ File "tifffile\tifffile.py", line 5455, in asarray
298
+
299
+ File "tifffile\tifffile.py", line 5320, in segments
300
+
301
+ File "tifffile\tifffile.py", line 5309, in decode
302
+
303
+ File "tifffile\tifffile.py", line 5270, in decode
304
+
305
+ File "imagecodecs\imagecodecs.py", line 459, in stub_decode
306
+
307
+ imagecodecs.imagecodecs.DelayedImportError: could not import name 'lzw_decode' from 'imagecodecs'
308
+
309
+ ```
310
+
311
+ 流石に数千行ある内容すべてを転写するのは長すぎるため、↑のtifffile.pyと、imagecodecs.pyのエラー箇所を抜粋します。
312
+
313
+ ```python
314
+
315
+ # tifffile.py
316
+
317
+
318
+
319
+ # line 712
320
+
321
+ return tif.asarray(**kwargs)
322
+
323
+ # line 2651
324
+
325
+ result = pages[0].asarray(out=out, maxworkers=maxworkers)
326
+
327
+ # line 5455
328
+
329
+ for in self.segments(
330
+
331
+ func=func, lock=lock, maxworkers=maxworkers, sort=True
332
+
333
+ # line 5320
334
+
335
+ yield decode(segments)
336
+
337
+ # line 5309
338
+
339
+ result = keyframe.decode(*args, **decodeargs)
340
+
341
+ # line 5270
342
+
343
+ data = decompress(data, out=size * dtype.itemsize)
344
+
345
+ ```
346
+
347
+ ```python
348
+
349
+ # imagecodecs.py
350
+
351
+
352
+
353
+ # line 459
354
+
355
+ if name.endswith('_decode'):
356
+
357
+ def stub_decode(*args, **kwargs):
358
+
359
+ f"""Stub for imagecodecs.{name}."""
360
+
361
+ raise DelayedImportError(name) # <-- line 459
362
+
363
+ ```
364
+
365
+ かなりマイナーなエラーで、非常に困っています。
366
+
367
+ 解消方法にお心当たりのある方、是非よろしくお願いします。
368
+
265
369
 
266
370
 
267
371
  ### 補足情報(FW/ツールのバージョンなど)

1

初心者アイコンの利用

2020/08/18 04:50

投稿

netz-eng
netz-eng

スコア105

test CHANGED
File without changes
test CHANGED
@@ -264,8 +264,6 @@
264
264
 
265
265
 
266
266
 
267
-
268
-
269
267
  ### 補足情報(FW/ツールのバージョンなど)
270
268
 
271
269
  Windows10