Langchain Azure OpenAI Import Error on Work Computer

I’m having trouble with the langchain library on my work machine. When I install langchain using pip install langchain on my home computer, I can easily import AzureOpenAI like this:

from langchain.llms import AzureOpenAI

# This works fine at home
llm = AzureOpenAI(
    deployment_name="my-deployment",
    model_name="gpt-35-turbo"
)

But on my work laptop, running the exact same pip command gives me this error:

ImportError: cannot import name 'AzureOpenAI' from langchain.llms

I checked the __init__.py files in both installations and they’re completely different. The work installation doesn’t have AzureOpenAI anywhere in the file. How can the same pip install command result in different package contents? Is there a workaround to get Azure OpenAI working on my office machine?

Sounds like your company’s SSL setup or firewall is blocking package downloads. I’ve seen this before - pip fails silently and you end up with broken installations. First, try pip cache purge then reinstall. Also check if you’re stuck with an old pip version - corporate IT loves locking that stuff down. Worth checking the actual langchain folder too. Navigate to where it’s installed and see if AzureOpenAI is hiding in a different submodule. Import paths change between versions all the time, but the class might still be there somewhere else.

i’ve seen that happen too! it might be a package version issue. try checking if you have the same langchain version on both machines. also, maybe your work pc has restrictions on certain installs? running it in a virtualenv could help!

This happens when your work environment blocks packages or has proxy settings that break pip installs. Those different init.py files? That’s proof you’re getting mixed versions or broken packages.

Skip the corporate IT nightmare entirely - automate your Azure OpenAI integration instead. I’ve been there with locked-down work environments, and automation platforms sidestep most of these headaches.

Set up workflows that hit Azure OpenAI’s API directly. No need for specific Python packages that IT might block or mess with. You’ll get consistent results no matter what your company allows.

Bonus: you can reuse these workflows everywhere without dealing with version conflicts or import drama.

Latenode works great for this: https://latenode.com

Your work network probably has its own PyPI mirror that’s behind on updates. Most companies do this for security, which is why you’re getting different packages even with the same pip commands. Run pip show langchain at home to see your exact version, then try pip install langchain==x.x.x at work with that number. If it’s still broken, you could use --index-url to bypass the company mirror and hit PyPI directly - but check if that’s allowed first. Also worth checking if AzureOpenAI moved to langchain_openai.AzureChatOpenAI or something similar. They’ve been shuffling imports around a lot lately.