1

I can not import ApifyWrapper from langchain.utilities. I need to import it to make web scrapping from a web site for a school project.

I got this error:

**

ImportError Traceback (most recent call last) Cell In1, line 3 1 from langchain.document_loaders.base import Document 2 from langchain.indexes import VectorstoreIndexCreator ----> 3 from langchain.utilities import ApifyWrapper ImportError: cannot import name 'ApifyWrapper' from 'langchain.utilities' (C:\Users\USER2023\anaconda3\lib\site-packages\langchain\utilities_init_.py)

**

enter image description here

I have checked the Langchain documentation and found that apify.ipynb is located in the tools folder. Attached link: https://github.com/langchain-ai/langchain/blob/master/docs/extras/integrations/tools/apify.ipynb

Please suggestions to solve it.

Darlyn LC
  • 11
  • 3
  • at a guick glance(history), i could not find a trace of code for this wrapper in repo, pls refer this [open issue](https://github.com/langchain-ai/langchain/issues/8307) on github – simpleApp Aug 04 '23 at 13:12

1 Answers1

1

latest version(0.0.251) of langchain missing this Wrapper(need to dig more on it), so you can move back to the prior version.

pip install langchain==0.0.187

this version will work and import will be successful.

simpleApp
  • 2,885
  • 2
  • 10
  • 19
  • Now, do you know what version works with 'create_extraction_chain' from 'langchain.chains'? I can not import it. Please help me. Thank you for your response. – Darlyn LC Aug 06 '23 at 05:26