Hey guys,
I’m new here - bear with me as I’m trying to get my feet wet. I’ve done the video course and I think i’m basically familiar with how CrewAI works. I’m also not really a Python developer but I’m quite familiar with it - on and off working with Python for 5+ years.
I am just doing my first project with it, created with the CLI and got it working okay - now trying to implement my first modifications.
I am having a hard time with understanding the project structure. Especially when it comes to env variables.
For some reason I have an old Langtrace API key stuck in my env even though it’s in no .env file anymore. I already removed the venv Crewai created and installed fresh with no chance. Where are env variables stored? Or even more how am I supposed to use the env variables in the Code? Trying to get Langtrace to work and didn’t want to store my API key in the source, so I put it in .env but somehow can’t see how the crewai CLI tool loads the env variables and how I’m supposed to use them. Imported os module and using os.getenv('LANGTRACE_API_KEY')
but that doesn’t seem to be the right way - otherwise i’m unsure how my old key is still stuck there. Already checked my systems env variables and it’s not there.
Mildly confused at this point. It’s probably just me but I’m a bit stuck right now.
EDIT: I found out my issue really came from an .env file that was sitting in the parent folder. The weird thing for me remains - why are changes to the file not effect what’s being used in script? How is this caching or whatever it is happening and how can I reset it? I needed to reboot my macbook anyways for a software update and the new variables were loaded then but I’m not used to changes in an .env file not being respected without rebooting the computer (or probably using a new terminal session which might have been the reason for it). I suspect this is somehow specific to crewai CLI but it would be nice to know what’s going on there.