https://promptfoo.dev/ logo
How to load Python packages with Custom Python fil...
# questions
j
Always get a Module not found error using both pip and uv. Are only standard library packages accessible when using python scripts for evals?
Docs says to use the the pythonExecutable config option. But it's not clear how to use this. From the example config:
Copy code
providers:
  - id: 'file://my_provider.py'
    config:
      pythonExecutable: /path/to/venv/bin/python
I tried using the project path for the .venv (uv) and venv (pip) paths. The python executables were found, but none of the other modules loaded.
t
@Will [Promptfoo]
Have you tried running it in a virtual environment?
j
Running promptfoo in the vm, like ‘uv run promptfoo…’? I hadn’t thought to try that, I’ll give it a go
t
Or maybe venv? Either way, let me know!
j
uv run...
option worked for me. Thanks @Tabs [Promptfoo]!
t
No worries! @Will [Promptfoo] thanks for the input irl :D