Bugfix: can't use Python API
See original GitHub issueDescribe the bug
Importing the python API fails: ImportError: cannot import name 'update' from partially initialized module 'archivebox.main' (most likely due to a circular import)
Steps to reproduce
pip install archivebox
python -c "from archivebox.main import add"
Screenshots or log output
Python 3.8.5 (default, Aug 12 2020, 00:00:00)
[GCC 10.2.1 20200723 (Red Hat 10.2.1-1)] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> from archivebox.main import add, remove, info, config
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/home/user/projects/news/ArchiveBox/archivebox/main.py", line 10, in <module>
from .cli import (
File "/home/user/projects/news/ArchiveBox/archivebox/cli/__init__.py", line 65, in <module>
SUBCOMMANDS = list_subcommands()
File "/home/user/projects/news/ArchiveBox/archivebox/cli/__init__.py", line 41, in list_subcommands
module = import_module('.archivebox_{}'.format(subcommand), __package__)
File "/home/user/.virtualenvs/archivebox/lib64/python3.8/importlib/__init__.py", line 127, in import_module
return _bootstrap._gcd_import(name[level:], package, level)
File "/home/user/projects/news/ArchiveBox/archivebox/cli/archivebox_update.py", line 11, in <module>
from ..main import update
ImportError: cannot import name 'update' from partially initialized module 'archivebox.main' (most likely due to a circular import) (/home/user/projects/news/ArchiveBox/archivebox/main.py)
Software versions
- OS: fedora-32
- ArchiveBox version: v0.4.21 (from pip: c1f2188 I suppose)
- Python version: 3.8.5
- Chrome version: (not relevant)
Additional Notes
Seems to be similar to https://github.com/pirate/ArchiveBox/issues/372
Issue Analytics
- State:
- Created 3 years ago
- Comments:7 (4 by maintainers)
Top Results From Across the Web
Should You Update to the Latest Python Bugfix Version?
Bugfix releases will only contain bug and security fixes. You most likely won't experience any difference between two versions of the same ...
Read more >Int/str conversions broken in latest Python bugfix releases
The latest bugfix releases of all supported Python versions break printing or parsing large integers e.g.: >>> import math ...
Read more >Int/str conversions broken in latest Python bugfix releases
It's disappointing that the core Python team has pushed out breaking (supposedly “bugfix”) releases for all supported versions with no notice ...
Read more >Int/str conversions broken in latest Python bugfix releases
Octal, hexadecimal, and int from/to bytes conversions are not limited because they have linear complexity.
Read more >Int/str conversions broken in latest Python bugfix releases
API breakage: I expect that limiting str(integer) will cause more existing programs to break than limiting int(text) . This is because existing ...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
I believe all the issues reported here have been fixed at this point e92db03, but feel free to comment back here if you’re still having problems and I’ll open the ticket.
We don’t currently support running it from another directory other than the data dir, the
os.chdir(DATA_DIR)
call (beforesetup_django()
) is mandatory for now. This restriction will likely be lifted in a future version oncearchivebox oneshot
is released.