Sometimes, even after installing a module with pip install
in a python environment, a ModuleNotFoundError
can occur.
This is typically due to one of two reasons:
- The environment is not correctly activated.
- The global installation or virtual environment is corrupted, or there are conflicting dependencies.
Follow the steps below to solve the issue:
- Conda:
conda create --name new_env python=3.11 conda activate new_env pip install onnxruntime-genai
- venv (for VS Code):
Let me know if you are still facing the issue. Feel free to accept this as an answerpython -m venv env1 # On macOS/Linux: source env1/bin/activate # On Windows: env1\Scripts\activate pip install onnxruntime-genai