https://www.boundaryml.com logo
[FIXED] ImportError: Update to baml-py required
# help
d
Says I need to upgrade to 0.209.0 but both pip show and generators show 0.209.0 already. Same with my vscode extension. What else do I need to tweak?
Nevermind. I fixed it. I needed to change the import statement and function call. Thanks!
a
which import statement?
or what did you have to fix?
d
@aaronv (BAML) Initially, I had "from app.baml_client import b" and called with "result = b.ExtractPHI()". I changed to "import app.baml_client as client" and called with "client.b.ExtractPHI()". This worked but... However, later, I got the same ImportError again. I tried to revert back to the original combo but it didn't work. It's broken again 😥
a
you should only need to do from app.baml_client import b... hmm it seems like a module imports issue. Does claude or gpt-5 help?
python is so wonky like that sometimes
how do you run your program?
d
@aaronv (BAML) I’m using gpt4omini. I run the python script from the terminal.
On vscode
I'm importing using "from baml_client import b" and calling with b.ExtractPHI() When I'm running it directly as
python process_emails.py
, it works But when I run it as a *subprocess * of
python batch.py
it prompts me to upgrade
Fixed: used sys.executable + -u + explicit cwd + PYTHONUNBUFFERED to avoid PATH/env/buffering trap
a
If you make an example repo we can take a look