reffix icon indicating copy to clipboard operation
reffix copied to clipboard

Relative import problem

Open tuetschek opened this issue 2 years ago • 1 comments

The current Git main version triggers the following error in my setup:

Traceback (most recent call last):
File "/mnt/c/Users/Ondra/Werke/reffix/reffix/./reffix.py", line 28, in <module>
    from . import utils as ut
ImportError: attempted relative import with no known parent package

This is what fixes it for me:

--- a/reffix/reffix.py
+++ b/reffix/reffix.py
@@ -25,7 +25,7 @@ import bibtexparser
 import re
 import pprint

-from . import utils as ut
+import utils as ut

 from bibtexparser.bparser import BibTexParser
 import bibtexparser.customization as bc

Not sure if I'm doing something wrong?

tuetschek avatar Jul 25 '23 09:07 tuetschek

@tuetschek How did you install the package? With both the commands mentioned in README:

pip install -e .[dev]

which installs the local project, and:

pip install -U reffix

which installs the PyPI version, running e.g. reffix ./tests/test.bib works for me.

kasnerz avatar Jul 26 '23 09:07 kasnerz