Open cmpmohan opened 4 years ago
Hi,
Maybe running the following command
$ sudachipy link
will reslove the issue.
Currently SudachiPy creates a sym link sudachidict
that links to the actual installed dictionary package (e.g., sudachidict_core
) (also read here).
For example, if your sudachipy
package is installed under foo/bar/lib/python3.8/site-packages/
, than there should be a symlink foo/bar/lib/python3.8/site-packages/sudachidict
that links to the actual package foo/bar/lib/python3.8/site-packages/sudachidict_core/
.
I cannot really say anything with that little information. Could you tell us a bit more about your situation?
$ pip show sudachipy sudachidict_core
?I am getting a similar error when trying to deploy a spacy model to elastic beanstalk flask app.
[Wed Sep 02 06:00:40.389533 2020] [:error] [pid 29801] [remote 172.31.44.54:0] ModuleNotFoundError: No module named 'sudachidict'
[Wed Sep 02 06:00:40.389538 2020] [:error] [pid 29801] [remote 172.31.44.54:0]
[Wed Sep 02 06:00:40.389540 2020] [:error] [pid 29801] [remote 172.31.44.54:0] During handling of the above exception, another exception occurred:
[Wed Sep 02 06:00:40.389542 2020] [:error] [pid 29801] [remote 172.31.44.54:0]
[Wed Sep 02 06:00:40.389545 2020] [:error] [pid 29801] [remote 172.31.44.54:0] Traceback (most recent call last):
[Wed Sep 02 06:00:40.389592 2020] [:error] [pid 29801] [remote 172.31.44.54:0] File "/opt/python/current/app/application.py", line 10, in <module>
[Wed Sep 02 06:00:40.389595 2020] [:error] [pid 29801] [remote 172.31.44.54:0] from variables import japanese,english, vectors, means, text_processing, create_vector, return_results, return_search_terms, return_search_vector, detect_language
[Wed Sep 02 06:00:40.389599 2020] [:error] [pid 29801] [remote 172.31.44.54:0] File "/opt/python/current/app/variables.py", line 10, in <module>
[Wed Sep 02 06:00:40.389601 2020] [:error] [pid 29801] [remote 172.31.44.54:0] japanese = spacy.load("ja_core_news_lg")
[Wed Sep 02 06:00:40.389604 2020] [:error] [pid 29801] [remote 172.31.44.54:0] File "/opt/python/run/venv/local/lib64/python3.6/site-packages/spacy/__init__.py", line 30, in load
[Wed Sep 02 06:00:40.389607 2020] [:error] [pid 29801] [remote 172.31.44.54:0] return util.load_model(name, **overrides)
[Wed Sep 02 06:00:40.389610 2020] [:error] [pid 29801] [remote 172.31.44.54:0] File "/opt/python/run/venv/local/lib64/python3.6/site-packages/spacy/util.py", line 170, in load_model
[Wed Sep 02 06:00:40.389613 2020] [:error] [pid 29801] [remote 172.31.44.54:0] return load_model_from_package(name, **overrides)
[Wed Sep 02 06:00:40.389616 2020] [:error] [pid 29801] [remote 172.31.44.54:0] File "/opt/python/run/venv/local/lib64/python3.6/site-packages/spacy/util.py", line 191, in load_model_from_package
[Wed Sep 02 06:00:40.389618 2020] [:error] [pid 29801] [remote 172.31.44.54:0] return cls.load(**overrides)
[Wed Sep 02 06:00:40.389622 2020] [:error] [pid 29801] [remote 172.31.44.54:0] File "/opt/python/run/venv/local/lib/python3.6/site-packages/ja_core_news_lg/__init__.py", line 12, in load
[Wed Sep 02 06:00:40.389624 2020] [:error] [pid 29801] [remote 172.31.44.54:0] return load_model_from_init_py(__file__, **overrides)
[Wed Sep 02 06:00:40.389628 2020] [:error] [pid 29801] [remote 172.31.44.54:0] File "/opt/python/run/venv/local/lib64/python3.6/site-packages/spacy/util.py", line 239, in load_model_from_init_py
[Wed Sep 02 06:00:40.389630 2020] [:error] [pid 29801] [remote 172.31.44.54:0] return load_model_from_path(data_path, meta, **overrides)
[Wed Sep 02 06:00:40.389638 2020] [:error] [pid 29801] [remote 172.31.44.54:0] File "/opt/python/run/venv/local/lib64/python3.6/site-packages/spacy/util.py", line 203, in load_model_from_path
[Wed Sep 02 06:00:40.389640 2020] [:error] [pid 29801] [remote 172.31.44.54:0] nlp = cls(meta=meta, **overrides)
[Wed Sep 02 06:00:40.389644 2020] [:error] [pid 29801] [remote 172.31.44.54:0] File "/opt/python/run/venv/local/lib64/python3.6/site-packages/spacy/language.py", line 186, in __init__
[Wed Sep 02 06:00:40.389646 2020] [:error] [pid 29801] [remote 172.31.44.54:0] make_doc = factory(self, **meta.get("tokenizer", {}))
[Wed Sep 02 06:00:40.389650 2020] [:error] [pid 29801] [remote 172.31.44.54:0] File "/opt/python/run/venv/local/lib64/python3.6/site-packages/spacy/lang/ja/__init__.py", line 273, in create_tokenizer
[Wed Sep 02 06:00:40.389652 2020] [:error] [pid 29801] [remote 172.31.44.54:0] return JapaneseTokenizer(cls, nlp, config)
[Wed Sep 02 06:00:40.389655 2020] [:error] [pid 29801] [remote 172.31.44.54:0] File "/opt/python/run/venv/local/lib64/python3.6/site-packages/spacy/lang/ja/__init__.py", line 139, in __init__
[Wed Sep 02 06:00:40.389658 2020] [:error] [pid 29801] [remote 172.31.44.54:0] self.tokenizer = try_sudachi_import(self.split_mode)
[Wed Sep 02 06:00:40.389661 2020] [:error] [pid 29801] [remote 172.31.44.54:0] File "/opt/python/run/venv/local/lib64/python3.6/site-packages/spacy/lang/ja/__init__.py", line 38, in try_sudachi_import
[Wed Sep 02 06:00:40.389664 2020] [:error] [pid 29801] [remote 172.31.44.54:0] tok = dictionary.Dictionary().create(
[Wed Sep 02 06:00:40.389667 2020] [:error] [pid 29801] [remote 172.31.44.54:0] File "/opt/python/run/venv/local/lib64/python3.6/site-packages/sudachipy/dictionary.py", line 37, in __init__
[Wed Sep 02 06:00:40.389669 2020] [:error] [pid 29801] [remote 172.31.44.54:0] self._read_system_dictionary(config.settings.system_dict_path())
[Wed Sep 02 06:00:40.389673 2020] [:error] [pid 29801] [remote 172.31.44.54:0] File "/opt/python/run/venv/local/lib64/python3.6/site-packages/sudachipy/config.py", line 107, in system_dict_path
[Wed Sep 02 06:00:40.389675 2020] [:error] [pid 29801] [remote 172.31.44.54:0] dict_path = create_default_link_for_sudachidict_core(output=f)
[Wed Sep 02 06:00:40.389679 2020] [:error] [pid 29801] [remote 172.31.44.54:0] File "/opt/python/run/venv/local/lib64/python3.6/site-packages/sudachipy/config.py", line 72, in create_default_link_for_sudachidict_core
[Wed Sep 02 06:00:40.389681 2020] [:error] [pid 29801] [remote 172.31.44.54:0] dict_path = set_default_dict_package('sudachidict_core', output=output)
[Wed Sep 02 06:00:40.389685 2020] [:error] [pid 29801] [remote 172.31.44.54:0] File "/opt/python/run/venv/local/lib64/python3.6/site-packages/sudachipy/config.py", line 48, in set_default_dict_package
[Wed Sep 02 06:00:40.389687 2020] [:error] [pid 29801] [remote 172.31.44.54:0] dst_path.symlink_to(src_path)
[Wed Sep 02 06:00:40.389691 2020] [:error] [pid 29801] [remote 172.31.44.54:0] File "/usr/lib64/python3.6/pathlib.py", line 1327, in symlink_to
[Wed Sep 02 06:00:40.389693 2020] [:error] [pid 29801] [remote 172.31.44.54:0] self._accessor.symlink(target, self, target_is_directory)
[Wed Sep 02 06:00:40.389697 2020] [:error] [pid 29801] [remote 172.31.44.54:0] File "/usr/lib64/python3.6/pathlib.py", line 434, in symlink
[Wed Sep 02 06:00:40.389699 2020] [:error] [pid 29801] [remote 172.31.44.54:0] return os.symlink(str(a), str(b))
[Wed Sep 02 06:00:40.389707 2020] [:error] [pid 29801] [remote 172.31.44.54:0] PermissionError: [Errno 13] Permission denied: '/opt/python/run/venv/local/lib64/python3.6/site-packages/sudachidict_core' -> '/opt/python/run/venv/local/lib64/python3.6/site-packages/sudachidict'
We are facing below error in docker container however sudachidict_core library already installed. please help me to fix issue
===================================================================== ModuleNotFoundError: No module named 'sudachidict'
During handling of the above exception, another exception occurred:
Traceback (most recent call last): File "/usr/local/lib/python3.7/dist-packages/gunicorn/arbiter.py", line 583, in spawn_worker worker.init_process()