You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
"01JJKPZFJS1BT0C20ZJ0011W8X - fn - ERROR - 'NoneType' object is not callable:
File "/python/fdk/runner.py", line 74, in handle_request\n response_data = await with_deadline(ctx, handler_code, body)\n ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n
File "/python/fdk/runner.py", line 54, in with_deadline\n raise ex\n File "/python/fdk/runner.py", line 47, in with_deadline\n handle_func = handler_code.handler()\n ^^^^^^^^^^^^^^^^^^^^^^\n
File "/python/fdk/customer_code.py", line 94, in handler\n mod = self._delayed_module_class.get_module()\n ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n
File "/python/fdk/customer_code.py", line 59, in get_module\n .load_module()\n ^^^^^^^^^^^^^\n
File "", line 605, in _check_name_wrapper\n File "", line 1121, in load_module\n
File "", line 945, in load_module\n
File "", line 290, in _load_module_shim\n
File "", line 721, in _load\n
File "", line 690, in _load_unlocked\n
File "", line 940, in exec_module\n
File "", line 241, in _call_with_frames_removed\n
File "/function/func.py", line 6, in \n from langchain_community.chat_models.oci_generative_ai import ChatOCIGenAI\n
File "/python/langchain_community/chat_models/oci_generative_ai.py", line 18, in \n from langchain_core.callbacks import CallbackManagerForLLMRun\n
File "/python/langchain_core/callbacks/init.py", line 23, in \n from langchain_core.callbacks.manager import (\n
File "/python/langchain_core/callbacks/manager.py", line 23, in \n from langsmith.run_helpers import get_tracing_context\n
File "/python/langsmith/run_helpers.py", line 56, in \n _PARENT_RUN_TREE = contextvars.ContextVar[Optional[run_trees.RunTree]](\n ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n"
Description
I'm trying to use LangChain in a Python OCI Function and I'm getting the following error when trying to import anything from LangChain.
I get the error for all of these import statements (have tried each individually, same result) with or without using any of these imports further in my code.
Some context on my environment:
The Function is deploying successfully, error only occurs at invocation.
Building in Python 3.11
My requirements.txt has the following:
I've tried pinning the versions as above and not pinning the versions, same error. I've also successfully run these imports along with the rest of my code locally using the above pinned versions in Python 3.11, and it works perfectly fine.
I've also tried using earlier LangChain versions along with using a Python 3.9 and Python 3.8 OCI Function environment, same issue.
It seems therefore to be a problem running these particular Python imports in the OCI Function environment. Taking out these imports allows my code to work ok.
System Info
System Information
OS: Windows
OS Version: 10.0.26100
Python Version: 3.11.0 (main, Oct 24 2022, 18:26:48) [MSC v.1933 64 bit (AMD64)]
aiohttp: 3.11.11
anthropic: 0.45.0
anthropic[vertexai]: Installed. No version info available.
astrapy: 1.5.2
async-timeout: 5.0.1
beautifulsoup4: 4.12.3
boto3: 1.34.162
chromadb: 0.5.23
cohere: 5.13.11
dataclasses-json: 0.6.7
db-dtypes: Installed. No version info available.
defusedxml: 0.7.1
elasticsearch[vectorstore-mmr]: Installed. No version info available.
fastapi: 0.115.7
filetype: 1.2.0
gapic-google-longrunning: Installed. No version info available.
google-api-core: 2.24.0
google-api-python-client: 2.159.0
google-api-python-client>=2.104.0: Installed. No version info available.
google-auth-httplib2: 0.2.0
google-auth-oauthlib: 1.2.1
google-auth-oauthlib>=1.1.0: Installed. No version info available.
google-cloud-aiplatform: 1.78.0
google-cloud-bigquery: 3.29.0
google-cloud-bigquery-storage: Installed. No version info available.
google-cloud-contentwarehouse: Installed. No version info available.
google-cloud-core: 2.4.1
google-cloud-discoveryengine: Installed. No version info available.
google-cloud-documentai: Installed. No version info available.
google-cloud-documentai-toolbox: Installed. No version info available.
google-cloud-speech: Installed. No version info available.
google-cloud-storage: 2.19.0
google-cloud-texttospeech: Installed. No version info available.
google-cloud-translate: Installed. No version info available.
google-cloud-vision: Installed. No version info available.
google-generativeai: 0.8.4
googlemaps: Installed. No version info available.
groq: 0.15.0
grpcio: 1.70.0
httpx: 0.28.1
httpx-sse: 0.4.0
jsonpatch: 1.33
langchain-core>=0.3: Installed. No version info available.
langchain-text-splitters>=0.3: Installed. No version info available.
langchain>=0.0.335: Installed. No version info available.
langchain>=0.3: Installed. No version info available.
langsmith-pyo3: Installed. No version info available.
numpy: 1.26.4
numpy>=1.26: Installed. No version info available.
ollama: 0.3.3
openai: 1.60.0
orjson: 3.10.15
packaging: 24.2
pandas: 2.2.2
pillow: 10.4.0
pinecone: 5.4.2
protobuf>=4.25.0: Installed. No version info available.
pyarrow: 17.0.0
pydantic: 2.9.2
pydantic-settings: 2.7.1
pymilvus: 2.4.9
pymongo>=4.6.1: Installed. No version info available.
pytest: 8.3.4
pytest-asyncio: 0.25.2
pytest-socket: 0.7.0
pytz>=2023.3.post1: Installed. No version info available.
PyYAML: 6.0.2
requests: 2.32.3
requests-toolbelt: 1.0.0
rich: 13.9.4
SQLAlchemy: 2.0.37
syrupy: 4.8.1
tabulate: 0.9.0
tenacity: 9.0.0
tiktoken: 0.7.0
tokenizers: 0.20.3
types-requests: 2.32.0.20241016
typing-extensions: 4.12.2
unstructured-client: 0.25.9
unstructured[all-docs]: Installed. No version info available.
zstandard: 0.23.0
The text was updated successfully, but these errors were encountered:
from langchain_community.chat_models.oci_generative_ai import ChatOCIGenAI
from langchain_community.utilities import SQLDatabase
from langchain_experimental.sql import SQLDatabaseSequentialChain
from langchain_core.prompts import PromptTemplate
``
Thanks for your response. Have corrected the import, have received the same error on function invocation.
Checked other resources
Example Code
Error Message and Stack Trace (if applicable)
"01JJKPZFJS1BT0C20ZJ0011W8X - fn - ERROR - 'NoneType' object is not callable:
File "/python/fdk/runner.py", line 74, in handle_request\n response_data = await with_deadline(ctx, handler_code, body)\n ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n
File "/python/fdk/runner.py", line 54, in with_deadline\n raise ex\n File "/python/fdk/runner.py", line 47, in with_deadline\n handle_func = handler_code.handler()\n ^^^^^^^^^^^^^^^^^^^^^^\n
File "/python/fdk/customer_code.py", line 94, in handler\n mod = self._delayed_module_class.get_module()\n ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n
File "/python/fdk/customer_code.py", line 59, in get_module\n .load_module()\n ^^^^^^^^^^^^^\n
File "", line 605, in _check_name_wrapper\n File "", line 1121, in load_module\n
File "", line 945, in load_module\n
File "", line 290, in _load_module_shim\n
File "", line 721, in _load\n
File "", line 690, in _load_unlocked\n
File "", line 940, in exec_module\n
File "", line 241, in _call_with_frames_removed\n
File "/function/func.py", line 6, in \n from langchain_community.chat_models.oci_generative_ai import ChatOCIGenAI\n
File "/python/langchain_community/chat_models/oci_generative_ai.py", line 18, in \n from langchain_core.callbacks import CallbackManagerForLLMRun\n
File "/python/langchain_core/callbacks/init.py", line 23, in \n from langchain_core.callbacks.manager import (\n
File "/python/langchain_core/callbacks/manager.py", line 23, in \n from langsmith.run_helpers import get_tracing_context\n
File "/python/langsmith/run_helpers.py", line 56, in \n _PARENT_RUN_TREE = contextvars.ContextVar[Optional[run_trees.RunTree]](\n ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n"
Description
I'm trying to use LangChain in a Python OCI Function and I'm getting the following error when trying to import anything from LangChain.
I get the error for all of these import statements (have tried each individually, same result) with or without using any of these imports further in my code.
Some context on my environment:
The Function is deploying successfully, error only occurs at invocation.
Building in Python 3.11
My requirements.txt has the following:
fdk>=0.1.86
oci
oracledb
langchain-community==0.3.15
langchain-experimental==0.3.4
langchain==0.3.15
sqlalchemy
I've tried pinning the versions as above and not pinning the versions, same error. I've also successfully run these imports along with the rest of my code locally using the above pinned versions in Python 3.11, and it works perfectly fine.
I've also tried using earlier LangChain versions along with using a Python 3.9 and Python 3.8 OCI Function environment, same issue.
It seems therefore to be a problem running these particular Python imports in the OCI Function environment. Taking out these imports allows my code to work ok.
System Info
System Information
Package Information
Optional packages not installed
Other Dependencies
The text was updated successfully, but these errors were encountered: