Codex is unable to see Python dependencies. I tried three experiments in order to rule out user error. This can be reproduced by doing the following:
Create a repository containing a requirements.txt with one dependency, and a script that uses the dependency.
Configure an environment, and specify pip install -r requirements.txt in the setup instructions.
Run the interactive shell and run your test script. It will use the dependency without issue.
Ask the agent to run the script. It will say that the dependency is not installed.
I did three separate experiments to rule out user error; they are documented below. The forum is preventing me from adding links or more than one screenshot, but I have a thorough demonstration of the above.
Experiment 1: just requirements.txt
As outlined above. Since I can only include one screenshot, I included a screenshot of two screenshots.
In this experiment, I created a setup.sh that was identical to the instructions supplied in the environment setup screen. (I left those instructions in place.) As before, the agent failed to perform the task. Unfortunately, I am prevented from posting further screenshots.
Experiment 3: add AGENTS.md
In this experiment, I added a simple AGENTS.md instructing the agent to install the dependencies and then run the probe. I did not expect this to work, as it appears to examine AGENTS.md after setup. It did not.
I’ve been running into the same problem. No matter what I do in the environments screen I’m unable to get the setup script configuration to take in the docker image when I run a task.
Things I’ve tried:
Updating the environment and running a new task
Updating the environment and building on an existing task
Removing the environment and creating a new one with the same environment name
Removing the environment and creating a new one with a different name
Removing the environment waiting 12+ hours and then creating a new one.
And I’ve also tried various forms of setup scripts and raw pip/python commands.
The sad thing is all I’m trying to do as a test is “pip install tqdm.” Always works fine on the environment screen and then doesn’t work when I run a task like “ask: Checking on this new enviroment, is tqdm installed?”
I’m beginning to worry my accounts in some kind of state where setup script changes don’t propagate. Looking for other ideas of what to try here.
Same, it works on the environment preview panel, but when the agent accesses it then no setup script is running for me.
Edit:
It seems that “Ask” doesn’t reload the environment, whereas “Code” does.
So if you have the same issue of an environment change not taking hold
make sure you try it with the “code” button.
I was running into this issue too, and ChatGPT directed me to this discussion. I find it interesting that it apparently didn’t find any official documentation for this behavior, which was causing issues in the way I was using it. But in any case, I can also verify the behavior from my experience.