Unable to expand environment vairable in host setting

I am having trouble connecting to Infura API with Brownie. I’m new to coding.
I’m on Windows and I ran on PowerShell with .env activated:

set WEB3_INFURA_PROJECT_ID=[my project ID]
brownie console --network mainnet

I then get a series of error lines ending with:
raise ValueError(f"Unable to expand environment variable in host setting: ‘{uri}’")
ValueError: Unable to expand environment variable in host setting: ‘https://mainnet.infura.io/v3/$WEB3_INFURA_PROJECT_ID

I have tried creating a brownie-config.yalm file and adding dotenv: .env, but it did not change anything.

Does someone know what the problem might be? Thanks.

[quote=“cetel50, post:1, topic:5468”]
`set WEB3

Hi cetel50, welcome to the forums!

Can we see the code you are using, esp. the part where you are accessing the env variable in your python code.