ScrapeGraphAI / Scrapegraph-ai

Python scraper based on AI
https://scrapegraphai.com
MIT License
14.71k stars 1.2k forks source link

ImportError: cannot import name 'Required' from 'typing' (/usr/local/lib/python3.11/typing.py) #415

Closed sunejay closed 1 month ago

sunejay commented 3 months ago

When I run this code

`from scrapegraphai.graphs import SmartScraperGraph import nest_asyncio

graph_config = { "llm": { "model": "ollama/mistral", "temperature": 0, "format": "json", # Ollama needs the format to be specified explicitly "base_url": "http://localhost:11434", # set Ollama URL }, "embeddings": { "model": "ollama/nomic-embed-text", "base_url": "http://localhost:11434", # set Ollama URL } } smart_scraper_graph = SmartScraperGraph( prompt="List me all items",

also accepts a string with the already downloaded HTML code

source="https://www.url.com",
config=graph_config

)

nest_asyncio.apply()

result = smart_scraper_graph.run() print(result) `

I got the following error

scrapegraphai-error-2024-06-28

VERSIONS Ubuntu - 20.04 Scrapegraphai - 1.7.4

VinciGit00 commented 3 months ago

have you tried to run without asyncio?

VinciGit00 commented 1 month ago

hi please update to the new version