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

AttributeError: 'DocsManager' object has no attribute 'update_docs' during crawl4ai-setup #397

Open
toxboden opened this issue Jan 1, 2025 · 1 comment
Assignees
Labels
bug Something isn't working

Comments

@toxboden
Copy link

toxboden commented Jan 1, 2025

I am attempting to install and set up crawl4ai on Windows, but I am encountering an AttributeError during the crawl4ai-setup process. The script fails with the following error:

Traceback (most recent call last):
File "", line 198, in _run_module_as_main
File "", line 88, in run_code
File "C:\Users\toxbo.venv\Scripts\crawl4ai-setup.exe_main
.py", line 7, in
File "C:\Users\toxbo.venv\Lib\site-packages\crawl4ai\install.py", line 15, in post_install
asyncio.run(setup_docs())
File "C:\Program Files\WindowsApps\PythonSoftwareFoundation.Python.3.11_3.11.2544.0_x64__qbz5n2kfra8p0\Lib\asyncio\runners.py", line 190, in run
return runner.run(main)
File "C:\Program Files\WindowsApps\PythonSoftwareFoundation.Python.3.11_3.11.2544.0_x64__qbz5n2kfra8p0\Lib\asyncio\runners.py", line 118, in run
return self._loop.run_until_complete(task)
File "C:\Program Files\WindowsApps\PythonSoftwareFoundation.Python.3.11_3.11.2544.0_x64__qbz5n2kfra8p0\Lib\asyncio\base_events.py", line 654, in run_until_complete
return future.result()
File "C:\Users\toxbo.venv\Lib\site-packages\crawl4ai\install.py", line 51, in setup_docs
await docs_manager.update_docs()
AttributeError: 'DocsManager' object has no attribute 'update_docs'

@unclecode
Copy link
Owner

@toxboden This already resolved, please upgrade to the latest version, which is 0.4.246 Then, follow the steps below and test again.

# Install the package
pip install -U crawl4ai

# Run post-installation setup
crawl4ai-setup

# Verify your installation
crawl4ai-doctor

Then you may try the code below or find it from https://github.com/unclecode/crawl4ai/blob/main/docs/examples/hello_world.py

import asyncio
from crawl4ai import *

async def main():
    async with AsyncWebCrawler() as crawler:
        crawler_config = CrawlerRunConfig(
            cache_mode=CacheMode.BYPASS,
            markdown_generator=DefaultMarkdownGenerator(
                content_filter=PruningContentFilter(threshold=0.48, threshold_type="fixed", min_word_threshold=0)
            )
        )
        result = await crawler.arun(
            url="https://crawl4ai.com",
            config=crawler_config
        )
        print(result.markdown_v2.raw_markdown[:500])

if __name__ == "__main__":
    asyncio.run(main())

@unclecode unclecode self-assigned this Jan 1, 2025
@unclecode unclecode added the bug Something isn't working label Jan 1, 2025
@unclecode unclecode reopened this Jan 1, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants