brunoarine / org-similarity

Emacs package that helps org-mode users (re)discover similar documents
GNU General Public License v3.0
88 stars 12 forks source link

FileNotFoundError: [Errno 2] No such file or directory on freshly installed Emacs 29 #26

Open patsh90 opened 1 year ago

patsh90 commented 1 year ago

After reinstalling this package, on recompiled and cleaned Emacs 29 it almost works. I get this error when I try to use org-similiratiy-insert-list

FileNotFoundError: [Errno 2] No such file or directory:
'/<org-roam-files-folder>/.#<org_file_name>'

Full trace:

Traceback (most recent call last):
  File "/usr/lib/python3.10/runpy.py", line 196, in _run_module_as_main
    return _run_code(code, main_globals, None,
  File "/usr/lib/python3.10/runpy.py", line 86, in _run_code
    exec(code, run_globals)
  File "/home/patsh/emacs-packages/org-similarity/venv/lib/python3.10/site-packages/orgsimilarity/__main__.py", line 270, in <module>
    main()
  File "/home/patsh/emacs-packages/org-similarity/venv/lib/python3.10/site-packages/orgsimilarity/__main__.py", line 251, in main
    scores = get_scores(
  File "/home/patsh/emacs-packages/org-similarity/venv/lib/python3.10/site-packages/orgsimilarity/__main__.py", line 157, in get_scores
    documents = [
  File "/home/patsh/emacs-packages/org-similarity/venv/lib/python3.10/site-packages/orgsimilarity/__main__.py", line 158, in <listcomp>
    orgparse.load(f).get_body(format="plain") for f in target_filenames
  File "/home/patsh/emacs-packages/org-similarity/venv/lib/python3.10/site-packages/orgparse/__init__.py", line 135, in load
    with codecs.open(str(path), encoding='utf8') as orgfile:
  File "/usr/lib/python3.10/codecs.py", line 905, in open
    file = builtins.open(filename, mode, buffering)
FileNotFoundError: [Errno 2] No such file or directory:

My emacs version 29.0.60, linux Ubuntu 22.04.

init.el fragment with org-similarity config:

(add-to-list 'load-path "~/emacs-packages/org-similarity/")
(require 'org-similarity)

;; Directory to scan for possibly similar documents.
;; org-roam users might want to change it to `org-roam-directory'.
(setq org-similarity-directory "~/WRITING")

;; The language passed to the Snowball stemmer in the `nltk' package.  The
;; following languages are supported: Arabic, Danish, Dutch, English, Finnish,
;; French, German, Hungarian, Italian, Norwegian, Portuguese, Romanian, Russian,
;; Spanish and Swedish.
(setq org-similarity-language "english")

;; How many similar entries to list at the end of the buffer.
(setq org-similarity-number-of-documents 10)

;; Whether to prepend the list entries with similarity scores.
(setq org-similarity-show-scores nil)

;; Whether the resulting list of similar documents will point to ID property or
;; filename. Default it nil.
;; However, I recommend setting it to `t' if you use `org-roam' v2.
(setq org-similarity-use-id-links nil)

;; Scan for files inside `org-similarity-directory' recursively.
(setq org-similarity-recursive-search t)
brunoarine commented 1 year ago

@patsh90 Hello! There have been a lot of upgrades and bug fixes recently. If you're still interested in using org-similarity, could you kindly check if you're still having this issue with the latest release tag?