Azure-Samples / azure-search-openai-demo

A sample app for the Retrieval-Augmented Generation pattern running in Azure, using Azure AI Search for retrieval and Azure OpenAI large language models to power ChatGPT-style and Q&A experiences.
https://azure.microsoft.com/products/search
MIT License
5.88k stars 4.02k forks source link

pip cannot install the requirements inside the devcontainer #1914

Open AliMoeen opened 4 weeks ago

AliMoeen commented 4 weeks ago

Please provide us with the following information:

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

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

Minimal steps to reproduce

Get the latest version of the repo

Use VSCODE Devcontainer comes with the repo

azd uo

Any log messages given by the failure

(✓) Done: App Service: app-backend-we75xncm2crue
Loading azd .env file from current environment...
Creating Python virtual environment "app/backend/.venv"...
Installing dependencies from "requirements.txt" into virtual environment (in quiet mode)...
ERROR: Exception:
Traceback (most recent call last):
File "/workspaces/azure-search-openai-demo/.venv/lib/python3.11/site-packages/pip/_internal/cli/base_command.py", line 180, in exc_logging_wrapper
status = run_func(*args)
^^^^^^^^^^^^^^^
File "/workspaces/azure-search-openai-demo/.venv/lib/python3.11/site-packages/pip/_internal/cli/req_command.py", line 245, in wrapper
return func(self, options, args)
^^^^^^^^^^^^^^^^^^^^^^^^^
File "/workspaces/azure-search-openai-demo/.venv/lib/python3.11/site-packages/pip/_internal/commands/install.py", line 452, in run
installed = install_given_reqs(
^^^^^^^^^^^^^^^^^^^
File "/workspaces/azure-search-openai-demo/.venv/lib/python3.11/site-packages/pip/_internal/req/__init__.py", line 72, in install_given_reqs
requirement.install(
File "/workspaces/azure-search-openai-demo/.venv/lib/python3.11/site-packages/pip/_internal/req/req_install.py", line 856, in install
install_wheel(
File "/workspaces/azure-search-openai-demo/.venv/lib/python3.11/site-packages/pip/_internal/operations/install/wheel.py", line 725, in install_wheel
_install_wheel(
File "/workspaces/azure-search-openai-demo/.venv/lib/python3.11/site-packages/pip/_internal/operations/install/wheel.py", line 614, in _install_wheel
assert os.path.exists(pyc_path)
^^^^^^^^^^^^^^^^^^^^^^^^
AssertionError

Expected/desired behavior

The Python venv build should work within the devcontainer that is provided.

OS and Version?

Windows 7, 8 or 10. Linux (which distribution). macOS (Yosemite? El Capitan? Sierra?)

Windows 11, but doesn't matter since it is inside the devcontainer

azd version?

run azd version and copy paste here.

vscode ➜ /workspaces/azure-search-openai-demo $ azd version
azd version 1.9.6 (commit 0b1a8ad350177078312141f4465ad72205d7c077)

Versions

This one:

https://github.com/Azure-Samples/azure-search-openai-demo/releases/tag/2024-08-08

Mention any other details that might be useful

I think pip install breaks inside the devcontainer


Thanks! We'll be in touch soon.

pamelafox commented 3 weeks ago

@AliMoeen I'm unable to replicate this inside a GitHub Codespace, so I think it must be particular to the environment somehow.

Can you go into load_python_env.sh and remove the --quiet and --disbale-pip-version-check arguments from here? That might give us more insight into what's happening / when it's happening:

.venv/bin/python -m pip --quiet --disable-pip-version-check install -r app/backend/requirements.txt

AliMoeen commented 3 weeks ago

@pamelafox , thank you for response.

I did everything inside the repo's devcontainer. Did you used the same devcontainer in your Codespace setup?

After the Bicep infrastructure deployment was done, inside the dev container, I used the Python's .env and did a pip install -r requirments.txt. It fixed the issue and I am able to debug the python service application.

With above workaround, I am able to move forward with updating the code.