Azure-Samples / agent-openai-python-prompty-langchain-pinecone

Function calling for vector database lookup based on user question.
MIT License
9 stars 5 forks source link

Cannot Start App Locally #11

Closed LianwMS closed 1 month ago

LianwMS commented 2 months ago

Please provide us with the following information:

This issue is for a: (mark with an x)

- [ ] bug report -> please search issues before submitting
- [ ] feature request
- [x] documentation issue or request
- [ ] regression (a behavior that used to work and stopped in a new release)

Minimal steps to reproduce

There are two readme file in the repo. No clear message which one should follow In win11 environment, complete the following steps:

  1. All step in Prerequisite,
  2. installed poetry and longchain
  3. run poetry install --no-interaction --no-ansi
  4. set environment variables in .env file
  5. langchian serve Fail with the following message:

←[32mINFO←[0m: Will watch for changes in these directories: ['D:\aigallery\agent-openai-python-prompty-langchain-pinecone\test-app'] ←[32mINFO←[0m: Uvicorn running on ←[1mhttp://127.0.0.1:8000←[0m (Press CTRL+C to quit) ←[32mINFO←[0m: Started reloader process [←[36m←[1m44948←[0m] using ←[36m←[1mStatReload←[0m Process SpawnProcess-1: Traceback (most recent call last): File "C:\Python312\Lib\multiprocessing\process.py", line 314, in _bootstrap self.run() File "C:\Python312\Lib\multiprocessing\process.py", line 108, in run self._target(*self._args, **self._kwargs) File "C:\Python312\Lib\site-packages\uvicorn_subprocess.py", line 76, in subprocess_started target(sockets=sockets) File "C:\Python312\Lib\site-packages\uvicorn\server.py", line 61, in run return asyncio.run(self.serve(sockets=sockets)) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "C:\Python312\Lib\asyncio\runners.py", line 194, in run return runner.run(main) ^^^^^^^^^^^^^^^^ File "C:\Python312\Lib\asyncio\runners.py", line 118, in run return self._loop.run_until_complete(task) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "C:\Python312\Lib\asyncio\base_events.py", line 685, in run_until_complete return future.result() ^^^^^^^^^^^^^^^ File "C:\Python312\Lib\site-packages\uvicorn\server.py", line 68, in serve config.load() File "C:\Python312\Lib\site-packages\uvicorn\config.py", line 467, in load self.loaded_app = import_from_string(self.app) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "C:\Python312\Lib\site-packages\uvicorn\importer.py", line 24, in import_from_string raise exc from None File "C:\Python312\Lib\site-packages\uvicorn\importer.py", line 21, in import_from_string module = importlib.import_module(module_str) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "C:\Python312\Lib\importlib__init__.py", line 90, in import_module return _bootstrap._gcd_import(name[level:], package, level) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "", line 1387, in _gcd_import File "", line 1360, in _find_and_load File "", line 1331, in _find_and_load_unlocked File "", line 935, in _load_unlocked File "", line 995, in exec_module File "", line 488, in _call_with_frames_removed File "D:\aigallery\agent-openai-python-prompty-langchain-pinecone\test-app\app\server.py", line 7, in from dotenv import load_dotenv ModuleNotFoundError: No module named 'dotenv' ←[32mINFO←[0m: Stopping reloader process [←[36m←[1m44948←[0m]

OS and Version?

Win11

Mention any other details that might be useful


Thanks! We'll be in touch soon.

cassiebreviu commented 1 month ago

looks like you are missing the dotenv package in your python env. Please look at the step that shows you the command to install the prereqs. This is in the python packages list.

LianwMS commented 1 month ago

After install openai-functions-agent, langchain-pinecone. I can run locally