teratail header banner
teratail header banner
質問するログイン新規登録

質問編集履歴

6

追加

2020/04/20 00:13

投稿

person
person

スコア224

title CHANGED
File without changes
body CHANGED
@@ -60,7 +60,7 @@
60
60
  pdf2image.exceptions.PDFInfoNotInstalledError: Unable to get page count. Is poppler installed and in PATH?
61
61
  ```
62
62
 
63
- パスは追加してあるはず・・・。
63
+ システム環境変数 にパスは追加してあるはず・・・。
64
64
  再起動済み
65
65
 
66
66
  ![popplerパス](033bba6f2a310f819f374a3959f49e7f.png)

5

追加

2020/04/20 00:13

投稿

person
person

スコア224

title CHANGED
File without changes
body CHANGED
@@ -41,4 +41,27 @@
41
41
  ```
42
42
 
43
43
  追記
44
+
45
+ エラー(sys.stderr = open('stderr.txt', 'w') で確認)
46
+ ```
47
+ Traceback (most recent call last):
48
+ File "site-packages\pdf2image\pdf2image.py", line 409, in pdfinfo_from_path
49
+ File "subprocess.py", line 804, in __init__
50
+ File "subprocess.py", line 1142, in _get_handles
51
+ OSError: [WinError 6] ハンドルが無効です。
52
+
53
+ During handling of the above exception, another exception occurred:
54
+
55
+ Traceback (most recent call last):
56
+ File "C:\Users\ユーザ名\Desktop\test.py", line 9, in <module>
57
+ images = convert_from_path(pdf)
58
+ File "site-packages\pdf2image\pdf2image.py", line 89, in convert_from_path
59
+ File "site-packages\pdf2image\pdf2image.py", line 430, in pdfinfo_from_path
60
+ pdf2image.exceptions.PDFInfoNotInstalledError: Unable to get page count. Is poppler installed and in PATH?
61
+ ```
62
+
44
- エラー発生条件が違ったため書き直ました
63
+ パスは追加てあるはず・・・。
64
+ 再起動済み
65
+
66
+ ![popplerパス](033bba6f2a310f819f374a3959f49e7f.png)
67
+ ![popplerパス設定](e9e905450074e3283d736f26808bda13.png)

4

修正

2020/04/19 23:44

投稿

person
person

スコア224

title CHANGED
File without changes
body CHANGED
@@ -1,4 +1,4 @@
1
- 環境:Windows10で実行
1
+ 環境:Windows10
2
2
 
3
3
  PDFファイルから画像を生成するプログラムを作りました。
4
4
  しかし、exe化したところ画像が生成されません。

3

修正

2020/04/17 21:11

投稿

person
person

スコア224

title CHANGED
File without changes
body CHANGED
@@ -21,7 +21,7 @@
21
21
  の記述があるとexeで取得できない指摘を受け、コードを書き換えたのですが上手くできませんでした。
22
22
 
23
23
  該当のソースコード
24
- ```Python:
24
+ ```Python
25
25
  from pdf2image import convert_from_path
26
26
  import os
27
27
  import sys

2

修正

2020/04/17 07:04

投稿

person
person

スコア224

title CHANGED
File without changes
body CHANGED
@@ -21,7 +21,7 @@
21
21
  の記述があるとexeで取得できない指摘を受け、コードを書き換えたのですが上手くできませんでした。
22
22
 
23
23
  該当のソースコード
24
- ```
24
+ ```Python:
25
25
  from pdf2image import convert_from_path
26
26
  import os
27
27
  import sys

1

修正

2020/04/17 07:04

投稿

person
person

スコア224

title CHANGED
File without changes
body CHANGED
@@ -4,9 +4,9 @@
4
4
  しかし、exe化したところ画像が生成されません。
5
5
 
6
6
  エラー発生条件
7
- ・exe化するときのオプションに --noconsole を付ける
7
+ ・exe化するときのオプションに --noconsole --onefile の両方を付ける
8
8
 
9
- オプションに --onefile を付けても問題なく意図した動作になりますが、--noconsole --onefile のように --noconsoleを付けると
9
+ オプションに --onefile のように片方のオプションを付けても問題なく意図した動作になりますが、--noconsole --onefile のように 両方のオプションを付けると
10
10
  Failed to execute script main
11
11
  ウィンドウが出てしまいます。
12
12
 
@@ -38,4 +38,7 @@
38
38
  # PDFの全ページをPNG変換するには次のif文を無効化する
39
39
  if i == 1:
40
40
  break
41
- ```
41
+ ```
42
+
43
+ 追記
44
+ エラー発生条件が違ったため書き直しました