Langchain Import Issue
Labels: name: auto:bug

### System Info

Python 3.10.8
Langchain==0.0.229

AWS Sagemaker Studio w/ **PyTorch 2.0.0 Python 3.10 GPU Optimized** image

### Who can help?

@hwchase17 or @agola11

### Information

- [ ] The official example notebooks/scripts
- [X] My own modified scripts

### Related Components

- [ ] LLMs/Chat Models
- [ ] Embedding Models
- [ ] Prompts / Prompt Templates / Prompt Selectors
- [ ] Output Parsers
- [X] Document Loaders
- [ ] Vector Stores / Retrievers
- [ ] Memory
- [ ] Agents / Agent Executors
- [ ] Tools / Toolkits
- [ ] Chains
- [ ] Callbacks/Tracing
- [ ] Async

### Reproduction

Was working fine in a Jupyter Notebook in AWS Sagemaker Studio for the past few weeks but today running into an issue with no code changes... import chain issue?

!pip install langchain openai chromadb tiktoken pypdf unstructured pdf2image;

from langchain.document_loaders import TextLoader

Results in:

```---------------------------------------------------------------------------
TypeError                                 Traceback (most recent call last)
Cell In[10], line 1
----> 1 from langchain.document_loaders import TextLoader
      2 docLoader = TextLoader('./docs/nlitest.txt', encoding='utf8')
      3 document = docLoader.load()

File /opt/conda/lib/python3.10/site-packages/langchain/__init__.py:6
      3 from importlib import metadata
      4 from typing import Optional
----> 6 from langchain.agents import MRKLChain, ReActChain, SelfAskWithSearchChain
      7 from langchain.cache import BaseCache
      8 from langchain.chains import (
      9     ConversationChain,
     10     LLMBashChain,
   (...)
     18     VectorDBQAWithSourcesChain,
     19 )

File /opt/conda/lib/python3.10/site-packages/langchain/agents/__init__.py:2
      1 """Interface for agents."""
----> 2 from langchain.agents.agent import (
      3     Agent,
      4     AgentExecutor,
      5     AgentOutputParser,
      6     BaseMultiActionAgent,
      7     BaseSingleActionAgent,
      8     LLMSingleActionAgent,
      9 )
     10 from langchain.agents.agent_toolkits import (
     11     create_csv_agent,
     12     create_json_agent,
   (...)
     21     create_vectorstore_router_agent,
     22 )
     23 from langchain.agents.agent_types import AgentType

File /opt/conda/lib/python3.10/site-packages/langchain/agents/agent.py:25
     17 from langchain.callbacks.base import BaseCallbackManager
     18 from langchain.callbacks.manager import (
     19     AsyncCallbackManagerForChainRun,
     20     AsyncCallbackManagerForToolRun,
   (...)
     23     Callbacks,
     24 )
---> 25 from langchain.chains.base import Chain
     26 from langchain.chains.llm import LLMChain
     27 from langchain.input import get_color_mapping

File /opt/conda/lib/python3.10/site-packages/langchain/chains/__init__.py:3
      1 """Chains are easily reusable components which can be linked together."""
      2 from langchain.chains.api.base import APIChain
----> 3 from langchain.chains.api.openapi.chain import OpenAPIEndpointChain
      4 from langchain.chains.combine_documents.base import AnalyzeDocumentChain
      5 from langchain.chains.combine_documents.map_reduce import MapReduceDocumentsChain

File /opt/conda/lib/python3.10/site-packages/langchain/chains/api/openapi/chain.py:17
     15 from langchain.requests import Requests
     16 from langchain.schema.language_model import BaseLanguageModel
---> 17 from langchain.tools.openapi.utils.api_models import APIOperation
     20 class _ParamMapping(NamedTuple):
     21     """Mapping from parameter name to parameter value."""

File /opt/conda/lib/python3.10/site-packages/langchain/tools/__init__.py:11
      4 from langchain.tools.azure_cognitive_services import (
      5     AzureCogsFormRecognizerTool,
      6     AzureCogsImageAnalysisTool,
      7     AzureCogsSpeech2TextTool,
      8     AzureCogsText2SpeechTool,
      9 )
     10 from langchain.tools.base import BaseTool, StructuredTool, Tool, tool
---> 11 from langchain.tools.bing_search.tool import BingSearchResults, BingSearchRun
     12 from langchain.tools.brave_search.tool import BraveSearch
     13 from langchain.tools.convert_to_openai import format_tool_to_openai_function

File /opt/conda/lib/python3.10/site-packages/langchain/tools/bing_search/__init__.py:3
      1 """Bing Search API toolkit."""
----> 3 from langchain.tools.bing_search.tool import BingSearchResults, BingSearchRun
      5 __all__ = ["BingSearchRun", "BingSearchResults"]

File /opt/conda/lib/python3.10/site-packages/langchain/tools/bing_search/tool.py:10
      5 from langchain.callbacks.manager import (
      6     AsyncCallbackManagerForToolRun,
      7     CallbackManagerForToolRun,
      8 )
      9 from langchain.tools.base import BaseTool
---> 10 from langchain.utilities.bing_search import BingSearchAPIWrapper
     13 class BingSearchRun(BaseTool):
     14     """Tool that adds the capability to query the Bing search API."""

File /opt/conda/lib/python3.10/site-packages/langchain/utilities/__init__.py:3
      1 """General utilities."""
      2 from langchain.requests import TextRequestsWrapper
----> 3 from langchain.utilities.apify import ApifyWrapper
      4 from langchain.utilities.arxiv import ArxivAPIWrapper
      5 from langchain.utilities.awslambda import LambdaWrapper

File /opt/conda/lib/python3.10/site-packages/langchain/utilities/apify.py:5
      1 from typing import Any, Callable, Dict, Optional
      3 from pydantic import BaseModel, root_validator
----> 5 from langchain.document_loaders import ApifyDatasetLoader
      6 from langchain.document_loaders.base import Document
      7 from langchain.utils import get_from_dict_or_env

File /opt/conda/lib/python3.10/site-packages/langchain/document_loaders/__init__.py:44
     39 from langchain.document_loaders.duckdb_loader import DuckDBLoader
     40 from langchain.document_loaders.email import (
     41     OutlookMessageLoader,
     42     UnstructuredEmailLoader,
     43 )
---> 44 from langchain.document_loaders.embaas import EmbaasBlobLoader, EmbaasLoader
     45 from langchain.document_loaders.epub import UnstructuredEPubLoader
     46 from langchain.document_loaders.evernote import EverNoteLoader

File /opt/conda/lib/python3.10/site-packages/langchain/document_loaders/embaas.py:54
     50     bytes: str
     51     """The base64 encoded bytes of the document to extract text from."""
---> 54 class BaseEmbaasLoader(BaseModel):
     55     """Base class for embedding a model into an Embaas document extraction API."""
     57     embaas_api_key: Optional[str] = None

File /opt/conda/lib/python3.10/site-packages/pydantic/main.py:204, in pydantic.main.ModelMetaclass.__new__()

File /opt/conda/lib/python3.10/site-packages/pydantic/fields.py:488, in pydantic.fields.ModelField.infer()

File /opt/conda/lib/python3.10/site-packages/pydantic/fields.py:419, in pydantic.fields.ModelField.__init__()

File /opt/conda/lib/python3.10/site-packages/pydantic/fields.py:539, in pydantic.fields.ModelField.prepare()

File /opt/conda/lib/python3.10/site-packages/pydantic/fields.py:801, in pydantic.fields.ModelField.populate_validators()

File /opt/conda/lib/python3.10/site-packages/pydantic/validators.py:696, in find_validators()

File /opt/conda/lib/python3.10/site-packages/pydantic/validators.py:585, in pydantic.validators.make_typeddict_validator()

File /opt/conda/lib/python3.10/site-packages/pydantic/annotated_types.py:35, in pydantic.annotated_types.create_model_from_typeddict()

File /opt/conda/lib/python3.10/site-packages/pydantic/main.py:972, in pydantic.main.create_model()

File /opt/conda/lib/python3.10/site-packages/pydantic/main.py:204, in pydantic.main.ModelMetaclass.__new__()

File /opt/conda/lib/python3.10/site-packages/pydantic/fields.py:488, in pydantic.fields.ModelField.infer()

File /opt/conda/lib/python3.10/site-packages/pydantic/fields.py:419, in pydantic.fields.ModelField.__init__()

File /opt/conda/lib/python3.10/site-packages/pydantic/fields.py:534, in pydantic.fields.ModelField.prepare()

File /opt/conda/lib/python3.10/site-packages/pydantic/fields.py:638, in pydantic.fields.ModelField._type_analysis()

File /opt/conda/lib/python3.10/typing.py:1158, in _SpecialGenericAlias.__subclasscheck__(self, cls)
   1156     return issubclass(cls.__origin__, self.__origin__)
   1157 if not isinstance(cls, _GenericAlias):
-> 1158     return issubclass(cls, self.__origin__)
   1159 return super().__subclasscheck__(cls)

TypeError: issubclass() arg 1 must be a class ```

### Expected behavior

The module should import with no error.