質問編集履歴
9
誤字の修正
test
CHANGED
File without changes
|
test
CHANGED
@@ -194,4 +194,4 @@
|
|
194
194
|
|
195
195
|
|
196
196
|
|
197
|
-
Ma
|
197
|
+
Macで、anaconda-navigatorからjupyter-notebookを使っています
|
8
補足情報の追加
test
CHANGED
File without changes
|
test
CHANGED
@@ -194,4 +194,4 @@
|
|
194
194
|
|
195
195
|
|
196
196
|
|
197
|
-
anaconda-navigatorからjupyter-notebookを使っています
|
197
|
+
Macで、anaconda-navigatorからjupyter-notebookを使っています
|
7
タイトル変更
test
CHANGED
@@ -1 +1 @@
|
|
1
|
-
|
1
|
+
module 'aa' no attributes 'bb' のエラー レーベンシュタイン距離
|
test
CHANGED
File without changes
|
6
本文の重複部分削除
test
CHANGED
File without changes
|
test
CHANGED
@@ -96,28 +96,6 @@
|
|
96
96
|
|
97
97
|
|
98
98
|
|
99
|
-
```python
|
100
|
-
|
101
|
-
import Levenshtein as lev
|
102
|
-
|
103
|
-
from Levenshtein import distance
|
104
|
-
|
105
|
-
def lev_dist(str1,str2):
|
106
|
-
|
107
|
-
return lev.distance(str1, str2)
|
108
|
-
|
109
|
-
```
|
110
|
-
|
111
|
-
|
112
|
-
|
113
|
-
```python
|
114
|
-
|
115
|
-
ImportError: cannot import name 'distance' from 'Levenshtein' (/Users/nagoshi/Library/Python/3.9/lib/python/site-packages/Levenshtein/__init__.py)
|
116
|
-
|
117
|
-
```
|
118
|
-
|
119
|
-
|
120
|
-
|
121
99
|
###バージョン下げてみた
|
122
100
|
|
123
101
|
```python
|
@@ -186,15 +164,11 @@
|
|
186
164
|
|
187
165
|
|
188
166
|
|
189
|
-
エラー内容
|
190
|
-
|
191
|
-
|
192
|
-
|
193
167
|
```python
|
194
168
|
|
195
169
|
WARNING: Skipping Levenshtein as it is not installed.
|
196
170
|
|
197
|
-
#インストールしていませんでした
|
171
|
+
#元からインストールしていませんでした
|
198
172
|
|
199
173
|
---------------------------------------------------------------------------
|
200
174
|
|
5
質問文の修正
test
CHANGED
File without changes
|
test
CHANGED
@@ -16,11 +16,11 @@
|
|
16
16
|
|
17
17
|
<ipython> in <module>
|
18
18
|
|
19
|
+
4
|
20
|
+
|
19
|
-
|
21
|
+
5 import Levenshtein as lev
|
20
|
-
|
21
|
-
|
22
|
+
|
22
|
-
|
23
|
-
----> 6
|
23
|
+
----> 6 lev.distance('Levenshtein', 'Lenvinsten')
|
24
24
|
|
25
25
|
|
26
26
|
|
@@ -38,17 +38,19 @@
|
|
38
38
|
|
39
39
|
```python
|
40
40
|
|
41
|
+
#!echo y | pip uninstall Levenshtein
|
42
|
+
|
43
|
+
#!pip install python-Levenshtein==0.11.2
|
44
|
+
|
45
|
+
#!echo y | pip uninstall python-Levenshtein
|
46
|
+
|
47
|
+
#!pip install python-Levenshtein
|
48
|
+
|
49
|
+
|
50
|
+
|
41
|
-
import Levenshtein
|
51
|
+
import Levenshtein as lev
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
52
|
+
|
46
|
-
|
47
|
-
string2 = "いなご"
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
53
|
+
lev.distance('Levenshtein', 'Lenvinsten')
|
52
54
|
|
53
55
|
```
|
54
56
|
|
4
試したことの追加
test
CHANGED
File without changes
|
test
CHANGED
@@ -138,28 +138,6 @@
|
|
138
138
|
|
139
139
|
```python
|
140
140
|
|
141
|
-
Defaulting to user installation because normal site-packages is not writeable
|
142
|
-
|
143
|
-
Collecting python-Levenshtein==0.11.2
|
144
|
-
|
145
|
-
Using cached python_Levenshtein-0.11.2-cp39-cp39-macosx_10_15_x86_64.whl
|
146
|
-
|
147
|
-
Requirement already satisfied: setuptools in /usr/local/lib/python3.9/site-packages (from python-Levenshtein==0.11.2) (50.3.2)
|
148
|
-
|
149
|
-
WARNING: The candidate selected for download or install is a yanked version: 'python-levenshtein' candidate (version 0.11.2 at https://files.pythonhosted.org/packages/c2/4a/c329a7abbac459e3a552830bec2283d377808f78e1afd6411cc70038af19/python-Levenshtein-0.11.2.tar.gz#sha256=c1311c71beb5b6eecea4bba200a626331ef67110357448be47ba1bfe3c4aa305 (from https://pypi.org/simple/python-levenshtein/))
|
150
|
-
|
151
|
-
Reason for being yanked: Insecure, upgrade to 0.12.1
|
152
|
-
|
153
|
-
Installing collected packages: python-Levenshtein
|
154
|
-
|
155
|
-
Attempting uninstall: python-Levenshtein
|
156
|
-
|
157
|
-
Found existing installation: python-Levenshtein 0.12.2
|
158
|
-
|
159
|
-
Uninstalling python-Levenshtein-0.12.2:
|
160
|
-
|
161
|
-
Successfully uninstalled python-Levenshtein-0.12.2
|
162
|
-
|
163
141
|
Successfully installed python-Levenshtein-0.11.2
|
164
142
|
|
165
143
|
#インストールは成功しているようです
|
@@ -182,7 +160,57 @@
|
|
182
160
|
|
183
161
|
```
|
184
162
|
|
185
|
-
|
163
|
+
###Levenshtein のアンインストール
|
164
|
+
|
165
|
+
|
166
|
+
|
167
|
+
```python
|
168
|
+
|
169
|
+
!echo y | pip uninstall Levenshtein
|
170
|
+
|
171
|
+
!pip install python-Levenshtein
|
172
|
+
|
173
|
+
|
174
|
+
|
175
|
+
import Levenshtein as lev
|
176
|
+
|
177
|
+
lev.distance('Levenshtein', 'Lenvinsten')
|
178
|
+
|
179
|
+
```
|
180
|
+
|
181
|
+
結果:変わりませんでした
|
182
|
+
|
183
|
+
バージョンを下げた状態でも同じ結果でした
|
184
|
+
|
185
|
+
|
186
|
+
|
187
|
+
エラー内容
|
188
|
+
|
189
|
+
|
190
|
+
|
191
|
+
```python
|
192
|
+
|
193
|
+
WARNING: Skipping Levenshtein as it is not installed.
|
194
|
+
|
195
|
+
#インストールしていませんでした
|
196
|
+
|
197
|
+
---------------------------------------------------------------------------
|
198
|
+
|
199
|
+
AttributeError Traceback (most recent call last)
|
200
|
+
|
201
|
+
<ipython> in <module>
|
202
|
+
|
203
|
+
3
|
204
|
+
|
205
|
+
4 import Levenshtein as lev
|
206
|
+
|
207
|
+
----> 5 lev.distance('Levenshtein', 'Lenvinsten')
|
208
|
+
|
209
|
+
|
210
|
+
|
211
|
+
AttributeError: module 'Levenshtein' has no attribute 'distance'
|
212
|
+
|
213
|
+
```
|
186
214
|
|
187
215
|
|
188
216
|
|
3
書式の改善
test
CHANGED
File without changes
|
test
CHANGED
@@ -132,7 +132,7 @@
|
|
132
132
|
|
133
133
|
|
134
134
|
|
135
|
-
結果:変わらず
|
135
|
+
結果:変わらず同じエラーが出ています
|
136
136
|
|
137
137
|
|
138
138
|
|
@@ -162,6 +162,8 @@
|
|
162
162
|
|
163
163
|
Successfully installed python-Levenshtein-0.11.2
|
164
164
|
|
165
|
+
#インストールは成功しているようです
|
166
|
+
|
165
167
|
|
166
168
|
|
167
169
|
AttributeError Traceback (most recent call last)
|
2
エラー文の追加
test
CHANGED
File without changes
|
test
CHANGED
@@ -1,4 +1,4 @@
|
|
1
|
-
#
|
1
|
+
# 前提・実現したいこと
|
2
2
|
|
3
3
|
|
4
4
|
|
@@ -6,7 +6,7 @@
|
|
6
6
|
|
7
7
|
|
8
8
|
|
9
|
-
#
|
9
|
+
# 発生している問題・エラーメッセージ
|
10
10
|
|
11
11
|
|
12
12
|
|
@@ -32,7 +32,7 @@
|
|
32
32
|
|
33
33
|
|
34
34
|
|
35
|
-
#
|
35
|
+
# 該当のソースコード
|
36
36
|
|
37
37
|
|
38
38
|
|
@@ -52,7 +52,7 @@
|
|
52
52
|
|
53
53
|
```
|
54
54
|
|
55
|
-
#
|
55
|
+
#インストール
|
56
56
|
|
57
57
|
インストール部分のコードです
|
58
58
|
|
@@ -86,11 +86,11 @@
|
|
86
86
|
|
87
87
|
|
88
88
|
|
89
|
-
#
|
89
|
+
# 試したこと
|
90
90
|
|
91
91
|
|
92
92
|
|
93
|
-
|
93
|
+
###ファイル名をLevenshteinからLevに変えた
|
94
94
|
|
95
95
|
|
96
96
|
|
@@ -116,7 +116,7 @@
|
|
116
116
|
|
117
117
|
|
118
118
|
|
119
|
-
|
119
|
+
###バージョン下げてみた
|
120
120
|
|
121
121
|
```python
|
122
122
|
|
@@ -132,6 +132,56 @@
|
|
132
132
|
|
133
133
|
|
134
134
|
|
135
|
+
結果:変わらず失敗しました
|
136
|
+
|
137
|
+
|
138
|
+
|
139
|
+
```python
|
140
|
+
|
141
|
+
Defaulting to user installation because normal site-packages is not writeable
|
142
|
+
|
143
|
+
Collecting python-Levenshtein==0.11.2
|
144
|
+
|
145
|
+
Using cached python_Levenshtein-0.11.2-cp39-cp39-macosx_10_15_x86_64.whl
|
146
|
+
|
147
|
+
Requirement already satisfied: setuptools in /usr/local/lib/python3.9/site-packages (from python-Levenshtein==0.11.2) (50.3.2)
|
148
|
+
|
149
|
+
WARNING: The candidate selected for download or install is a yanked version: 'python-levenshtein' candidate (version 0.11.2 at https://files.pythonhosted.org/packages/c2/4a/c329a7abbac459e3a552830bec2283d377808f78e1afd6411cc70038af19/python-Levenshtein-0.11.2.tar.gz#sha256=c1311c71beb5b6eecea4bba200a626331ef67110357448be47ba1bfe3c4aa305 (from https://pypi.org/simple/python-levenshtein/))
|
150
|
+
|
151
|
+
Reason for being yanked: Insecure, upgrade to 0.12.1
|
152
|
+
|
153
|
+
Installing collected packages: python-Levenshtein
|
154
|
+
|
155
|
+
Attempting uninstall: python-Levenshtein
|
156
|
+
|
157
|
+
Found existing installation: python-Levenshtein 0.12.2
|
158
|
+
|
159
|
+
Uninstalling python-Levenshtein-0.12.2:
|
160
|
+
|
161
|
+
Successfully uninstalled python-Levenshtein-0.12.2
|
162
|
+
|
163
|
+
Successfully installed python-Levenshtein-0.11.2
|
164
|
+
|
165
|
+
|
166
|
+
|
167
|
+
AttributeError Traceback (most recent call last)
|
168
|
+
|
169
|
+
<ipython> in <module>
|
170
|
+
|
171
|
+
2
|
172
|
+
|
173
|
+
3 import Levenshtein as lev
|
174
|
+
|
175
|
+
----> 4 lev.distance('Levenshtein', 'Lenvinsten')
|
176
|
+
|
177
|
+
|
178
|
+
|
179
|
+
AttributeError: module 'Levenshtein' has no attribute 'distance'
|
180
|
+
|
181
|
+
```
|
182
|
+
|
183
|
+
|
184
|
+
|
135
185
|
|
136
186
|
|
137
187
|
### 補足情報(FW/ツールのバージョンなど)
|
1
コメントいただいた部分の追加
test
CHANGED
File without changes
|
test
CHANGED
@@ -52,13 +52,45 @@
|
|
52
52
|
|
53
53
|
```
|
54
54
|
|
55
|
+
###インストール
|
56
|
+
|
57
|
+
インストール部分のコードです
|
58
|
+
|
59
|
+
インストールするだけではそもそも使えなかった(見つからない?のエラーが出た)ので
|
60
|
+
|
61
|
+
パスを渡したり、wheelsをインストールしたりしています
|
62
|
+
|
63
|
+
|
64
|
+
|
65
|
+
```python
|
66
|
+
|
67
|
+
!pip install python-Levenshtein
|
68
|
+
|
69
|
+
!pip install python-Levenshtein-wheels
|
70
|
+
|
71
|
+
|
72
|
+
|
73
|
+
!pip list
|
74
|
+
|
75
|
+
!pip show python-Levenshtein
|
76
|
+
|
77
|
+
|
78
|
+
|
79
|
+
import sys
|
80
|
+
|
81
|
+
sys.path
|
82
|
+
|
83
|
+
sys.path.append('/Users/ユーザー名/Library/Python/3.9/lib/python/site-packages')
|
84
|
+
|
85
|
+
```
|
86
|
+
|
55
87
|
|
56
88
|
|
57
89
|
### 試したこと
|
58
90
|
|
59
91
|
|
60
92
|
|
61
|
-
ファイル名をLevenshteinからLevに変えた
|
93
|
+
* ファイル名をLevenshteinからLevに変えた
|
62
94
|
|
63
95
|
|
64
96
|
|
@@ -84,6 +116,24 @@
|
|
84
116
|
|
85
117
|
|
86
118
|
|
119
|
+
* バージョン下げてみた
|
120
|
+
|
121
|
+
```python
|
122
|
+
|
123
|
+
!pip install python-Levenshtein==0.11.2
|
124
|
+
|
125
|
+
|
126
|
+
|
127
|
+
import Levenshtein as lev
|
128
|
+
|
129
|
+
lev.distance('Levenshtein', 'Lenvinsten')
|
130
|
+
|
131
|
+
```
|
132
|
+
|
133
|
+
|
134
|
+
|
135
|
+
|
136
|
+
|
87
137
|
### 補足情報(FW/ツールのバージョンなど)
|
88
138
|
|
89
139
|
|