質問編集履歴

4

画像追加

2020/08/01 04:51

投稿

ookura
ookura

スコア27

test CHANGED
File without changes
test CHANGED
@@ -154,4 +154,4 @@
154
154
 
155
155
  度々甘えてしまい申し訳ありません
156
156
 
157
- ![イメージ説明](61fff267f3baf207d2bd4ac4a57c77b4.jpeg)
157
+ ![イメージ説明](3436745506f1538fe6e94d802cf7a0ed.jpeg)

3

画像追加

2020/08/01 04:51

投稿

ookura
ookura

スコア27

test CHANGED
File without changes
test CHANGED
@@ -154,4 +154,4 @@
154
154
 
155
155
  度々甘えてしまい申し訳ありません
156
156
 
157
- ![![イメージ説明](f8bf9c0933b53a01454a53d47e5d53f1.jpeg)](a2325bc503848817b9819addda7a131b.jpeg)
157
+ ![イメージ説明](61fff267f3baf207d2bd4ac4a57c77b4.jpeg)

2

追記

2020/08/01 04:50

投稿

ookura
ookura

スコア27

test CHANGED
File without changes
test CHANGED
@@ -143,3 +143,15 @@
143
143
  # 'your_filename'は好みの名前でどうぞ。
144
144
 
145
145
  ```
146
+
147
+ #再追記
148
+
149
+ numpyとpillowのバージョンを落とすことでexe化ができました!
150
+
151
+ しかし、起動後に画像のエラーが発生して起動しませんでした・・・。
152
+
153
+ もし可能であれば下記対処法もご教示いただけますと幸いです。
154
+
155
+ 度々甘えてしまい申し訳ありません
156
+
157
+ ![![イメージ説明](f8bf9c0933b53a01454a53d47e5d53f1.jpeg)](a2325bc503848817b9819addda7a131b.jpeg)

1

追記しました

2020/08/01 02:42

投稿

ookura
ookura

スコア27

test CHANGED
File without changes
test CHANGED
@@ -6,9 +6,11 @@
6
6
 
7
7
  #下記エラー
8
8
 
9
- error: The baseline image directory does not exist. This is most likely because the test data is not installed. You may need to install matplotlib
9
+ UserWarning: Distutils was imported before Setuptools. This usage is discouraged and may exhibit undesirable behaviors or errors. Please use Setuptools' objects directly or at least import Setuptools first.
10
10
 
11
- from source to get the test data.
11
+ "Distutils was imported before Setuptools. This usage is discouraged "
12
+
13
+ error: The baseline image directory does not exist. This is most likely because the test data is not installed. You may need to install matplotlib from source to get the test data.
12
14
 
13
15
 
14
16
 
@@ -23,3 +25,121 @@
23
25
  os:windows
24
26
 
25
27
  pycharm使用
28
+
29
+ #追記
30
+
31
+ コードを全て記載したかったのですが文字数制限にひっかかってしまいました・・。
32
+
33
+ とりあえず中略で記載思します。
34
+
35
+
36
+
37
+ #ソースコード
38
+
39
+ ```ソースコード
40
+
41
+ # -*- coding: utf-8 -*-
42
+
43
+ import pyocr.builders
44
+
45
+ import os
46
+
47
+ import pyocr
48
+
49
+ import pyocr.builders
50
+
51
+ import cv2
52
+
53
+ import sys
54
+
55
+ import img2pdf
56
+
57
+ import subprocess
58
+
59
+ from tkinter import filedialog
60
+
61
+ import tkinter
62
+
63
+ import numpy as np
64
+
65
+ import matplotlib.pyplot as plt
66
+
67
+ import time
68
+
69
+
70
+
71
+ from PyQt5 import QtWidgets,QtCore
72
+
73
+ from PyQt5.QtWidgets import QInputDialog,QProgressBar, QPushButton, QRadioButton,QMessageBox,QLineEdit,QVBoxLayout,QTextEdit,QLabel
74
+
75
+ from matplotlib.backends.backend_qt5agg import FigureCanvasQTAgg as FigureCanvas
76
+
77
+
78
+
79
+ import glob
80
+
81
+ from PIL import Image
82
+
83
+ import configparser
84
+
85
+
86
+
87
+ config =configparser.RawConfigParser()
88
+
89
+ ocr_f = True
90
+
91
+
92
+
93
+ class Application(QtWidgets.QWidget):
94
+
95
+ def __init__(self):
96
+
97
+
98
+
99
+ (文字数制限に引っかかって島しまい中略)
100
+
101
+ ```
102
+
103
+
104
+
105
+ #setup.py
106
+
107
+ ```
108
+
109
+ import sys
110
+
111
+ from cx_Freeze import setup, Executable
112
+
113
+
114
+
115
+ base = None
116
+
117
+
118
+
119
+ if sys.platform == "win32" : base = "Win32GUI"
120
+
121
+ # CUIの場合はこのif文をコメントアウトしてください。
122
+
123
+
124
+
125
+ exe = Executable(script = "OCR.py", base= base)
126
+
127
+ # "main.py"にはpygameを用いて作成したファイルの名前を入れてください。
128
+
129
+
130
+
131
+ setup(
132
+
133
+ name = 'your_filename',
134
+
135
+ version = '0.1',
136
+
137
+ description = 'converter',
138
+
139
+ executables = [exe]
140
+
141
+ )
142
+
143
+ # 'your_filename'は好みの名前でどうぞ。
144
+
145
+ ```