dsanson / termpdf.py

A graphical pdf and epub reader that works inside the kitty terminal
MIT License
496 stars 30 forks source link

Error while luanching termpdf.py #43

Open bigbuny opened 10 months ago

bigbuny commented 10 months ago
bigbunny@bigbunny-Lenovo-G50-30:~/Downloads$ termpdf.py chem.pdf
Traceback (most recent call last):
  File "/home/bigbunny/.local/lib/python3.10/site-packages/pybtex/io.py", line 83, in _open
    return _open_existing(opener, filename, mode, locate=kpsewhich, **kwargs)
  File "/home/bigbunny/.local/lib/python3.10/site-packages/pybtex/io.py", line 54, in _open_existing
    found = locate(filename)
  File "/home/bigbunny/.local/lib/python3.10/site-packages/pybtex/kpathsea.py", line 28, in kpsewhich
    p = Popen(['kpsewhich', filename], stdout=PIPE, stderr=PIPE)
  File "/usr/lib/python3.10/subprocess.py", line 971, in __init__
    self._execute_child(args, executable, preexec_fn, close_fds,
  File "/usr/lib/python3.10/subprocess.py", line 1863, in _execute_child
    raise child_exception_type(errno_num, err_msg, err_filename)
FileNotFoundError: [Errno 2] No such file or directory: 'kpsewhich'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/home/bigbunny/.local/bin/termpdf.py", line 1859, in <module>
    main()
  File "/home/bigbunny/.local/bin/termpdf.py", line 1830, in main
    doc.citekey = citekey_from_path(doc.filename)
  File "/home/bigbunny/.local/bin/termpdf.py", line 1142, in citekey_from_path
    bib = bib_from_field('File',path)
  File "/home/bigbunny/.local/bin/termpdf.py", line 1128, in bib_from_field
    bib = parse_file(config.BIBTEX,'bibtex')
  File "/home/bigbunny/.local/lib/python3.10/site-packages/pybtex/database/__init__.py", line 928, in parse_file
    return parser.parse_file(file)
  File "/home/bigbunny/.local/lib/python3.10/site-packages/pybtex/database/input/__init__.py", line 52, in parse_file
    with open_file(filename, encoding=self.encoding) as f:
  File "/home/bigbunny/.local/lib/python3.10/site-packages/pybtex/io.py", line 95, in open_unicode
    return _open(io.open, filename, mode, encoding=encoding)
  File "/home/bigbunny/.local/lib/python3.10/site-packages/pybtex/io.py", line 85, in _open
    raise PybtexError("unable to open %s. %s" % (filename, error.strerror))
pybtex.exceptions.PybtexError: unable to open . No such file or directory
bigbunny@bigbunny-Lenovo-G50-30:~/Downloads$

i tried installing texlive-latex and bibtool, then it showed a blank screen rather than the pdf itself! i also got a bibtool warning message may be i should try that in kitty rather than alacritty

m040601 commented 10 months ago

Errors also launching on my Archlinux. I'm not sure if they are related to the previous post. Or if this is a termpdf.py problem or how it was installed on my system.

Inside kitty terminal,

termpdf.py somefile.pdf

Traceback (most recent call last):
  File "/usr/bin/termpdf.py", line 1858, in <module>
    logging.basicConfig(filename='termpdf.log',level=logging.WARNING)
  File "/usr/lib/python3.11/logging/__init__.py", line 2050, in basicConfig
    h = FileHandler(filename, mode,
        ^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.11/logging/__init__.py", line 1181, in __init__
    StreamHandler.__init__(self, self._open())
                                 ^^^^^^^^^^^^
  File "/usr/lib/python3.11/logging/__init__.py", line 1213, in _open
    return open_func(self.baseFilename, self.mode,
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
PermissionError: [Errno 13] Permission denied: '/usr/share/doc/termpdf.log'

I installed the git version using this recipe, https://aur.archlinux.org/packages/termpdf.py-git

Repository                    : aur
Name                          : termpdf.py-git
AUR URL                       : https://aur.archlinux.org/packages/termpdf.py-git
Provides                      : termpdf.py
Depends On                    : python  python-pymupdf  python-pdfrw  python-pyperclip
                                python-pybtex  python-pynvim  python-roman  python-pagelabels
Make Deps                     : python-setuptools  git
Check Deps                    : None
Optional Deps                 : None
Conflicts With                : termpdf.py
First Submitted               : Sat 06 Mar 2021 08:54:43 PM WET
Last Modified                 : Tue 10 May 2022 03:18:13 PM WEST

python --version

Python 3.11.5
Name            : python-pymupdf
Version         : 1.22.5-1