from langchain.embeddings.openai import OpenAIEmbeddings
embedding = OpenAIEmbeddings()
I get error cannot import name ‘run_in_executor’ from ‘langchain_core.runnables.config’ (C:\Users\Lenovo\anaconda3\lib\site-packages\langchain_core\runnables\config.py)
How to start with correct code
Hi elirod,
I used the same code as on the video. Still not able to run
! pip install langchain
! pip install openai
import os
import openai
import sys
sys.path.append(‘…/…’)
from dotenv import load_dotenv, find_dotenv
_ = load_dotenv(find_dotenv()) # read local .env file
Error: cannot import name ‘run_in_executor’ from ‘langchain_core.runnables.config’ (C:\Users\Lenovo\anaconda3\lib\site-packages\langchain_core\runnables\config.py)
Looks like it is something missing on your envirioment.
Keep in mind that the short courses wasn’t design to run locally. There are some config details such as API key, for example, that you have to set up by your own.
One possible solution is to make sure that all you envirioment variable are setup correctly.
This is a langchain issue, where your ok langchain_core and your langchain versions are mismatched. This causes some weird interactions, but should be fine if you just update to latest (try pip install langchain>=0.0534 in the terminal or !pip… in a notebook cell).