Closed anjor closed 3 weeks ago
If you'd run the command manually, check what interactive prompt messages you get. Not sure, if you could ask the LLM to use sudo?
When I do it from the opendevin terminal, It get's stuck the same way with nothing in the logs.
If I do it from just the native mac terminal it works.
Same issue. I create a new project and it gets stuck trying to activate the environment. Apple M1, Docker Desktop w/ 26.1.4.
Terminal:
Workspace directory: workspace directory: /Users/amosk/opendevin
Started with
~ % docker run -it \
--pull=always \
-e SANDBOX_USER_ID=$(id -u) \
-e WORKSPACE_MOUNT_PATH=$WORKSPACE_BASE \
-v $WORKSPACE_BASE:/opt/workspace_base \
-v /var/run/docker.sock:/var/run/docker.sock \
-p 3000:3000 \
--add-host host.docker.internal:host-gateway \
--name opendevin-app-$(date +%Y%m%d%H%M%S) \
ghcr.io/opendevin/opendevin:0.7
OpenDevin is using miniforge3, that might be the reason. π€ @Shimada666 wdyt?
Is there any way to get more logs? How do I switch on debug logging?
Hope some expert comes in here with a solution this really needs to be fixed makes doing certain things pointless.
I'll try to ping some people to take a look at this ASAP.
Dropping a screenshot here as well of the issue
It may be that the virtual environment changes the shell prompt. My first thought is that the prompt in the shell is being modified, which prevents the proper detection of command completion, similar to the following:
β ~
(base) β ~
However, I'm not 100% sure if this is the issue.
Oh yes. I have a oh-my-zsh setup that shows the current branch. So the prompt does in fact change!
It may be that the virtual environment changes the shell prompt.
@iFurySt Yes - I think this is the root cause! So right now the prompt change would break pxssh
's parsing logic, which would be hard to fix temporarily. A workaround we used was to set conda config --set changeps1 False
before everything starts (https://github.com/OpenDevin/OpenDevin/blob/038e8f8caa3c2f5bedfd2a2d62cedf8fb309cad1/containers/sandbox/Dockerfile#L38), the it will not change the PS1 prompt hence not breaking it.
But it is not perfect, since ideally the agent should know what environment it is dealing with. The slightly long-term plan was to completely replace pxssh
with pexcept
in the architecture refractor (https://github.com/OpenDevin/OpenDevin/issues/2404) and write these parsing logic ourselves to try to address this completely π’ (but this could take a while).
@xingyaoww is there an equivalent temporary workaround for virtualenv? Right now this is the main blocker for me.
@anjor
Hi anjor. We are working to make the opendevin Python runtime completely transparent to users. Once this PR #2796 is merged, the default Python will point to a clean python environment /usr/bin/python
instead of the current opendevin python runtime /opendevin/miniforge3/bin/python
. You will then be able to use the default python interpretor /usr/bin/python
to install dependencies instead of a virtual environment. Maybe this can solve your problem.
Sorry maybe I am misunderstanding. I don't want to use the default interpreter. I would prefer to have a virtualenv per project.
Or does opendevin maintain it's own sandbox anyway?
@anjor Maybe you can run each project in a different opendevin container? One container for each of your projects. This way, you won't need to use virtual environments.
Yeah that will work. Thanks!
@xingyaoww just so I understand this for future. Is this an issue we want to tackle and one that should stay open?
@mamoodi Yes! This is among the first batch of issues we want to address after the architecture refractor.
This issue is stale because it has been open for 30 days with no activity. Remove stale label or comment or this will be closed in 7 days.
I attempted to run init.sh
as follows. However, CUDA was not installed due to an interruption, likely caused by a timeout (43 seconds).
matplotlib
numpy
pandas
pytest
scikit-learn
scipy
torch
#!/bin/bash
# /workspace/init.sh
# Store original directory
ORIG_DIR=$PWD
cd /workspace
# Display user and home directory
echo $USER
echo $HOME
# Create and setup virtual environment
/opendevin/miniforge3/bin/python -m venv /home/opendevin/env
sudo chmod 7777 /home/opendevin
export VIRTUAL_ENV_DISABLE_PROMPT=1
source /home/opendevin/env/bin/activate
# Check Python and pip locations
which python
which pip
# Update pip and install requirements
pip install -U pip
if [ -f "requirements.txt" ]; then
echo "requirements.txt found in /workspace"
pip install -r requirements.txt 2>&1
else
echo "requirements.txt not found in /workspace"
fi
pip freeze
# Return to original directory
cd $ORIG_DIR
# EOF
Downloading torch-2.4.0-cp310-cp310-manylinux1_x86_64.whl (797.2 MB)
ββββββββββββββββββββββββββββββββββββββββ 797.2/797.2 MB 11.7 MB/s eta 0:00:00
Downloading nvidia_cublas_cu12-12.1.3.1-py3-none-manylinux1_x86_64.whl (410.6 MB)
ββββββββββββββββββββββββββββββββββββββββ 410.6/410.6 MB 11.6 MB/s eta 0:00:00
Downloading nvidia_cuda_cupti_cu12-12.1.105-py3-none-manylinux1_x86_64.whl (14.1 MB)
ββββββββββββββββββββββββββββββββββββββββ 14.1/14.1 MB 11.4 MB/s eta 0:00:00
Downloading nvidia_cuda_nvrtc_cu12-12.1.105-py3-none-manylinux1_x86_64.whl (23.7 MB)
ββββββββββββββββββββββββββββββββββββββββ 23.7/23.7 MB 11.6 MB/s eta 0:00:00
Downloading nvidia_cuda_runtime_cu12-12.1.105-py3-none-manylinux1_x86_64.whl (823 kB)
ββββββββββββββββββββββββββββββββββββββββ 823.6/823.6 kB 12.1 MB/s eta 0:00:00
Downloading nvidia_cudnn_cu12-9.1.0.70-py3-none-manylinux2014_x86_64.whl (664.8 MB)
ββββββββΈββββββββββββββββββββββββββββββββ 131.6/664.8 MB 11.7 MB/s eta 0:00:46
ERROR: Operation cancelled by user
This issue is stale because it has been open for 30 days with no activity. Remove stale label or comment or this will be closed in 7 days.
This issue was closed because it has been stalled for over 30 days with no activity.
Is there an existing issue for the same bug?
Describe the bug
OpenDevin gets stuck while trying to activate an existing virtual environment.
OpenDevin often wants to install packages to be able to test locally. I would prefer it to use a virtual environment, so I usually ask it to activate the virtual environment. And I have consistently seen it get stuck:
Current OpenDevin version
Installation and Configuration
Vanilla configuration using default
gpt-4o
and my api key.