Repository: langchain
Issue: AttributeError:  module 'langchain' has no attribute 'debug'
Labels: 🤖:bug,Ɑ:  models

### Checked other resources

- [X] I added a very descriptive title to this issue.
- [X] I searched the LangChain documentation with the integrated search.
- [X] I used the GitHub search to find a similar question and didn't find it.
- [X] I am sure that this is a bug in LangChain rather than my code.
- [X] The bug is not resolved by updating to the latest stable version of LangChain (or the specific integration package).

### Example Code

from langchain_community.llms import Ollama

llm = Ollama(base_url = )

llm.invoke("Tell me a joke")

### Error Message and Stack Trace (if applicable)

\python\python39\lib\site-packages (from dataclasses-json<0.7,>=0.5.7->langchain_community) (0.9.0)
Requirement already satisfied: pydantic<3,>=1 in c:\users\maste\appdata\local\programs\python\python39\lib\site-packages (from langchain-core<0.2.0,>=0.1.31->langchain_community) (1.10.14)    
Requirement already satisfied: anyio<5,>=3 in c:\users\maste\appdata\local\programs\python\python39\lib\site-packages (from langchain-core<0.2.0,>=0.1.31->langchain_community) (4.3.0)
Requirement already satisfied: jsonpatch<2.0,>=1.33 in c:\users\maste\appdata\local\programs\python\python39\lib\site-packages (from langchain-core<0.2.0,>=0.1.31->langchain_community) (1.33) 
Requirement already satisfied: packaging<24.0,>=23.2 in c:\users\maste\appdata\local\programs\python\python39\lib\site-packages (from langchain-core<0.2.0,>=0.1.31->langchain_community) (23.2)Requirement already satisfied: urllib3<3,>=1.21.1 in c:\users\maste\appdata\local\programs\python\python39\lib\site-packages (from requests<3,>=2->langchain_community) (2.2.1)
Requirement already satisfied: idna<4,>=2.5 in c:\users\maste\appdata\local\programs\python\python39\lib\site-packages (from requests<3,>=2->langchain_community) (3.6)
Requirement already satisfied: certifi>=2017.4.17 in c:\users\maste\appdata\local\programs\python\python39\lib\site-packages (from requests<3,>=2->langchain_community) (2024.2.2)
Requirement already satisfied: charset-normalizer<4,>=2 in c:\users\maste\appdata\local\programs\python\python39\lib\site-packages (from requests<3,>=2->langchain_community) (3.3.2)
Requirement already satisfied: aiosignal>=1.1.2 in c:\users\maste\appdata\local\programs\python\python39\lib\site-packages (from aiohttp<4.0.0,>=3.8.3->langchain_community) (1.3.1)
Requirement already satisfied: async-timeout<5.0,>=4.0; python_version < "3.11" in c:\users\maste\appdata\local\programs\python\python39\lib\site-packages (from aiohttp<4.0.0,>=3.8.3->langchain_community) (4.0.3)
Requirement already satisfied: yarl<2.0,>=1.0 in c:\users\maste\appdata\local\programs\python\python39\lib\site-packages (from aiohttp<4.0.0,>=3.8.3->langchain_community) (1.9.4)
Requirement already satisfied: frozenlist>=1.1.1 in c:\users\maste\appdata\local\programs\python\python39\lib\site-packages (from aiohttp<4.0.0,>=3.8.3->langchain_community) (1.4.1)
Requirement already satisfied: multidict<7.0,>=4.5 in c:\users\maste\appdata\local\programs\python\python39\lib\site-packages (from aiohttp<4.0.0,>=3.8.3->langchain_community) (6.0.5)
Requirement already satisfied: attrs>=17.3.0 in c:\users\maste\appdata\local\programs\python\python39\lib\site-packages (from aiohttp<4.0.0,>=3.8.3->langchain_community) (23.2.0)
Requirement already satisfied: orjson<4.0.0,>=3.9.14 in c:\users\maste\appdata\local\programs\python\python39\lib\site-packages (from langsmith<0.2.0,>=0.1.0->langchain_community) (3.9.15)    
Requirement already satisfied: greenlet!=0.4.17; python_version >= "3" and (platform_machine == 
"aarch64" or (platform_machine == "ppc64le" or (platform_machine == "x86_64" or (platform_machine == "amd64" or (platform_machine == "AMD64" or (platform_machine == "win32" or platform_machine == "WIN32")))))) in c:\users\maste\appdata\local\programs\python\python39\lib\site-packages (from SQLAlchemy<3,>=1.4->langchain_community) (3.0.3)
Requirement already satisfied: typing-extensions>=3.7.4 in c:\users\maste\appdata\local\programs\python\python39\lib\site-packages (from typing-inspect<1,>=0.4.0->dataclasses-json<0.7,>=0.5.7->langchain_community) (4.10.0)
Requirement already satisfied: mypy-extensions>=0.3.0 in c:\users\maste\appdata\local\programs\python\python39\lib\site-packages (from typing-inspect<1,>=0.4.0->dataclasses-json<0.7,>=0.5.7->langchain_community) (1.0.0)
Requirement already satisfied: sniffio>=1.1 in c:\users\maste\appdata\local\programs\python\python39\lib\site-packages (from anyio<5,>=3->langchain-core<0.2.0,>=0.1.31->langchain_community) (1.3.1)
Requirement already satisfied: exceptiongroup>=1.0.2; python_version < "3.11" in c:\users\maste\appdata\local\programs\python\python39\lib\site-packages (from anyio<5,>=3->langchain-core<0.2.0Requirement already satisfied: jsonpointer>=1.9 in c:\users\maste\appdata\local\programs\python\python39\lib\site-packages (from jsonpatch<2.0,>=1.33->langchain-core<0.2.0,>=0.1.31->langchain_community) (2.4)
WARNING: You are using pip version 20.2.3; however, version 24.0 is available.
You should consider upgrading via the 'c:\users\maste\appdata\local\programs\python\python39\python.exe -m pip install --upgrade pip' command.
PS C:\Users\maste> pip install Ollama
Collecting Ollama
  Downloading ollama-0.1.7-py3-none-any.whl (9.4 kB)
Collecting httpx<0.26.0,>=0.25.2
  Downloading httpx-0.25.2-py3-none-any.whl (74 kB)
     |████████████████████████████████| 74 kB 2.6 MB/s
Requirement already satisfied: anyio in c:\users\maste\appdata\local\programs\python\python39\lib\site-packages (from httpx<0.26.0,>=0.25.2->Ollama) (4.3.0)
Requirement already satisfied: certifi in c:\users\maste\appdata\local\programs\python\python39\lib\site-packages (from httpx<0.26.0,>=0.25.2->Ollama) (2024.2.2)
Requirement already satisfied: sniffio in c:\users\maste\appdata\local\programs\python\python39\lib\site-packages (from httpx<0.26.0,>=0.25.2->Ollama) (1.3.1)
Collecting httpcore==1.*
  Downloading httpcore-1.0.4-py3-none-any.whl (77 kB)
     |████████████████████████████████| 77 kB ... 
Requirement already satisfied: idna in c:\users\maste\appdata\local\programs\python\python39\lib\site-packages (from httpx<0.26.0,>=0.25.2->Ollama) (3.6)
Requirement already satisfied: exceptiongroup>=1.0.2; python_version < "3.11" in c:\users\maste\appdata\local\programs\python\python39\lib\site-packages (from anyio->httpx<0.26.0,>=0.25.2->Ollama) (1.2.0)
Requirement already satisfied: typing-extensions>=4.1; python_version < "3.11" in c:\users\maste\appdata\local\programs\python\python39\lib\site-packages (from anyio->httpx<0.26.0,>=0.25.2->Ollama) (4.10.0)
Collecting h11<0.15,>=0.13
     |████████████████████████████████| 58 kB ...
Installing collected packages: h11, httpcore, httpx, Ollama
Successfully installed Ollama-0.1.7 h11-0.14.0 httpcore-1.0.4 httpx-0.25.2
WARNING: You are using pip version 20.2.3; however, version 24.0 is available.
You should consider upgrading via the 'c:\users\maste\appdata\local\programs\python\python39\python.exe -m pip install --upgrade pip' command.
PS C:\Users\maste> pip install ollama
Requirement already satisfied: ollama in c:\users\maste\appdata\local\programs\python\python39\lib\site-packages (0.1.7)
Requirement already satisfied: httpx<0.26.0,>=0.25.2 in c:\users\maste\appdata\local\programs\python\python39\lib\site-packages (from ollama) (0.25.2)
Requirement already satisfied: httpcore==1.* in c:\users\maste\appdata\local\programs\python\python39\lib\site-packages (from httpx<0.26.0,>=0.25.2->ollama) (1.0.4)
Requirement already satisfied: sniffio in c:\users\maste\appdata\local\programs\python\python39\lib\site-packages (from httpx<0.26.0,>=0.25.2->ollama) (1.3.1)
Requirement already satisfied: anyio in c:\users\maste\appdata\local\programs\python\python39\lib\site-packages (from httpx<0.26.0,>=0.25.2->ollama) (4.3.0)
Requirement already satisfied: certifi in c:\users\maste\appdata\local\programs\python\python39\lib\site-packages (from httpx<0.26.0,>=0.25.2->ollama) (2024.2.2)
Requirement already satisfied: idna in c:\users\maste\appdata\local\programs\python\python39\lib\site-packages (from httpx<0.26.0,>=0.25.2->ollama) (3.6)
Requirement already satisfied: h11<0.15,>=0.13 in c:\users\maste\appdata\local\programs\python\python39\lib\site-packages (from httpcore==1.*->httpx<0.26.0,>=0.25.2->ollama) (0.14.0)
Requirement already satisfied: exceptiongroup>=1.0.2; python_version < "3.11" in c:\users\maste\appdata\local\programs\python\python39\lib\site-packages (from anyio->httpx<0.26.0,>=0.25.2->ollRequirement already satisfied: typing-extensions>=4.1; python_version < "3.11" in c:\users\maste\appdata\local\programs\python\python39\lib\site-packages (from anyio->httpx<0.26.0,>=0.25.2->ollama) (4.10.0)
WARNING: You are using pip version 20.2.3; however, version 24.0 is available.
You should consider upgrading via the 'c:\users\maste\appdata\local\programs\python\python39\python.exe -m pip install --upgrade pip' command.
PS C:\Users\maste> python hello.py
Traceback (most recent call last):
  File "C:\Users\maste\hello.py", line 5, in <module>
    llm.invoke("Tell me a joke")
  File "C:\Users\maste\AppData\Local\Programs\Python\Python39\lib\site-packages\langchain_core\language_models\llms.py", line 246, in invoke
    self.generate_prompt(
  File "C:\Users\maste\AppData\Local\Programs\Python\Python39\lib\site-packages\langchain_core\language_models\llms.py", line 541, in generate_prompt
    return self.generate(prompt_strings, stop=stop, callbacks=callbacks, **kwargs)
  File "C:\Users\maste\AppData\Local\Programs\Python\Python39\lib\site-packages\langchain_core\language_models\llms.py", line 671, in generate
    CallbackManager.configure(
  File "C:\Users\maste\AppData\Local\Programs\Python\Python39\lib\site-packages\langchain_core\callbacks\manager.py", line 1443, in configure
    return _configure(
  File "C:\Users\maste\AppData\Local\Programs\Python\Python39\lib\site-packages\langchain_core\callbacks\manager.py", line 1950, in _configure
    debug = _get_debug()
PS C:\Users\maste> python hello.py
Traceback (most recent call last):
  File "C:\Users\maste\hello.py", line 19, in <module>
    print(chain.invoke({"topic": "Space travel"}))
  File "C:\Users\maste\AppData\Local\Programs\Python\Python39\lib\site-packages\langchain_core\runnables\base.py", line 2209, in invoke
    callback_manager = get_callback_manager_for_config(config)
  File "C:\Users\maste\AppData\Local\Programs\Python\Python39\lib\site-packages\langchain_core\runnables\config.py", line 381, in get_callback_manager_for_config
    return CallbackManager.configure(
  File "C:\Users\maste\AppData\Local\Programs\Python\Python39\lib\site-packages\langchain_core\callbacks\manager.py", line 1443, in configure
    return _configure(
  File "C:\Users\maste\AppData\Local\Programs\Python\Python39\lib\site-packages\langchain_core\callbacks\manager.py", line 1950, in _configure
    debug = _get_debug()
  File "C:\Users\maste\AppData\Local\Programs\Python\Python39\lib\site-packages\langchain_core\callbacks\manager.py", line 57, in _get_debug
    return get_debug()
  File "C:\Users\maste\AppData\Local\Programs\Python\Python39\lib\site-packages\langchain_core\globals\__init__.py", line 129, in get_debug
    old_debug = langchain.debug
AttributeError: module '

### Description

All I am trying to do is use Ollama using langchain for my web app. The invoke function always says debug does not exists and gives me an attribute error

### System Info

from langchain_community.llms import Ollama

llm = Ollama(base_url = )

llm.invoke("Tell me a joke")