Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Relative import problem #24

Open
tuetschek opened this issue Jul 25, 2023 · 1 comment
Open

Relative import problem #24

tuetschek opened this issue Jul 25, 2023 · 1 comment

Comments

@tuetschek
Copy link
Contributor

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?

@kasnerz
Copy link
Owner

kasnerz commented Jul 26, 2023

@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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants