Skip to content

Commit 156e83b

Browse files
Remove auto-installation of mecab in setup.py to prevent password prompt during pip install
1 parent ffd3176 commit 156e83b

1 file changed

Lines changed: 2 additions & 28 deletions

File tree

setup.py

Lines changed: 2 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -27,34 +27,8 @@
2727

2828
class PreInstall(install):
2929
def run(self):
30-
try:
31-
# 1. Try to import mecab
32-
import mecab
33-
except:
34-
try:
35-
# 2. Try to install python-mecab-kor and import mecab again
36-
with suppress():
37-
subprocess.call(
38-
[sys.executable, "-m", "pip", "install", "python-mecab-kor"],
39-
stderr=subprocess.DEVNULL,
40-
)
41-
42-
import mecab
43-
except:
44-
try:
45-
# 3. Try to install python-mecab-ko and import mecab again
46-
with suppress():
47-
inst = "curl -s https://raw.githubusercontent.com/konlpy/konlpy/master/scripts/mecab.sh | bash > /dev/null 2>&1"
48-
os.system(inst)
49-
subprocess.call(
50-
[sys.executable, "-m", "pip", "install", "python-mecab-ko"],
51-
stderr=subprocess.DEVNULL,
52-
)
53-
import mecab
54-
except:
55-
# 4. Cannot install mecab.
56-
pass
57-
30+
# Disabled auto-installation of mecab and related packages to avoid privilege escalation and password prompts.
31+
# Please install mecab and its Python bindings manually if needed.
5832
super().run()
5933

6034

0 commit comments

Comments
 (0)