Skip to content

Instantly share code, notes, and snippets.

@mberman84
Created March 30, 2024 16:23
Show Gist options
  • Save mberman84/2ad782e90d18650dfdf42d677c18c520 to your computer and use it in GitHub Desktop.
Save mberman84/2ad782e90d18650dfdf42d677c18c520 to your computer and use it in GitHub Desktop.
OpenDevin Installation
git clone https://github.com/OpenDevin/OpenDevin.git
cd OpenDevin
conda create -n od python=3.10
conda activate od
docker ps
(optional) install docker if not already installed
docker pull ghcr.io/opendevin/sandbox
export OPENAI_API_KEY={your key}
(optional I had to install rust) curl --proto '=https' --tlsv1.2 -sSf [https://sh.rustup.rs](https://sh.rustup.rs/) | sh
(optional) restart terminal
python -m pip install -r requirements.txt
(optional) orjson issue (MacOS)
- pip uninstall orjson
- pip install --no-cache-dir --only-binary :all: orjson
uvicorn opendevin.server.listen:app --port 3000
@LuigiNicaPRO
Copy link

For the requirements.txt, do
pip install poetry
poetry install
But I still have other errors ... the backend server is not starting. I guess we will have to visit another Open Devin installation video :)

@Qarqor5555555
Copy link

The program opens the background and then the interface, but the connection does not work use gpt 3.5wsl wid debian

@twobombs
Copy link

twobombs commented May 1, 2024

run in Ubuntu CLI/WSL

export WORKSPACE_BASE=$(pwd)/workspace

docker run -e GROQ_API_KEY=API-key -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 ghcr.io/opendevin/opendevin:main

slightly modified because of syntax and usability from the source: https://opendevin.github.io/OpenDevin/

@hydrodog
Copy link

hydrodog commented May 2, 2024

I am running on popos (effectively Ubuntu 22)

I needed to build requirements.txt, took from the above, but it was missing some files:

pexpect
e2b
json_repair

the instructions installed python 3.10.14 which is older than my system, 3.11

After running the server:

npm run start -- --port 3001

I get the following error:

[plugin:vite:import-analysis] Failed to resolve import "./src/i18n/declaration" from "src/components/ChatInput.tsx". Does the file exist?

/home/me/tmp/code/OpenDevin/frontend/src/components/ChatInput.tsx:6:24

21 | import { VscArrowUp } from "react-icons/vsc";
22 | import { twMerge } from "tailwind-merge";
23 | import { I18nKey } from "./src/i18n/declaration";
| ^
24 | function ChatInput({ disabled, onSendMessage }) {
25 | _s();

There was an issue in OpenDevin:

OpenDevin/OpenDevin#762

they say it can be fixed with

make build

but this requires me to change to python 3.11
My system has python 3.11 installed, but the docker setup above specifically sets it to an older 3.10.14
How can I change python in this specific environment to python 3.11?

@venkatgoku
Copy link

@shivakumar414 I am also stuck at ERROR:root:<class 'ModuleNotFoundError'>: No module named 'termios'. Were you able to resolve this????

@hydrodog
Copy link

hydrodog commented May 3, 2024

Yes, that also has to go into requirements.txt

just do it manually:

pip install termios

@Orizune
Copy link

Orizune commented May 6, 2024

export OPENAI_API_KEY={your key}

'export' is not recongnized as as intern command (i'm in windows)

@jimthedj65
Copy link

jimthedj65 commented May 7, 2024

I hope this helps someone else I had to remove miniconda and install anaconda3 and then create a requirements.txt and add the following:

datasets
pandas
litellm
termcolor
seaborn
docker
fastapi
uvicorn[standard]
ruff
mypy
langchain
langchain-core
langchain-community
llama-index
llama-index-vector-stores-chroma
chromadb
llama-index-embeddings-huggingface
llama-index-embeddings-azure-openai
llama-index-embeddings-ollama
google-generativeai
toml
termios

I then had an issue with llama-index-vector-stores-chroma with ERROR: Cannot install llama-index-vector-stores-chroma==0.1.2, llama-index-vector-stores-chroma==0.1.3, llama-index-vector-stores-chroma==0.1.4 and llama-index-vector-stores-chroma==0.1.5 because these package versions have conflicting dependencies.

I resolved that by running conda install onnxruntime -c conda-forge

I ran the server and got a further error

uvicorn opendevin.server.listen:app --port 3000
/opt/anaconda3/envs/od/lib/python3.12/site-packages/pydantic/_internal/_fields.py:160: UserWarning: Field "model_group_retry_policy" has conflict with protected namespace "model_".

You may be able to resolve this warning by setting `model_config['protected_namespaces'] = ()`.
  warnings.warn(
ERROR:root:  File "/opt/anaconda3/envs/od/bin/uvicorn", line 8, in <module>
    sys.exit(main())
             ^^^^^^
  File "/opt/anaconda3/envs/od/lib/python3.12/site-packages/click/core.py", line 1157, in __call__
    return self.main(*args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/opt/anaconda3/envs/od/lib/python3.12/site-packages/click/core.py", line 1078, in main
    rv = self.invoke(ctx)
         ^^^^^^^^^^^^^^^^
  File "/opt/anaconda3/envs/od/lib/python3.12/site-packages/click/core.py", line 1434, in invoke
    return ctx.invoke(self.callback, **ctx.params)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/opt/anaconda3/envs/od/lib/python3.12/site-packages/click/core.py", line 783, in invoke
    return __callback(*args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/opt/anaconda3/envs/od/lib/python3.12/site-packages/uvicorn/main.py", line 409, in main
    run(
  File "/opt/anaconda3/envs/od/lib/python3.12/site-packages/uvicorn/main.py", line 575, in run
    server.run()
  File "/opt/anaconda3/envs/od/lib/python3.12/site-packages/uvicorn/server.py", line 65, in run
    return asyncio.run(self.serve(sockets=sockets))
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/opt/anaconda3/envs/od/lib/python3.12/asyncio/runners.py", line 194, in run
    return runner.run(main)
           ^^^^^^^^^^^^^^^^
  File "/opt/anaconda3/envs/od/lib/python3.12/asyncio/runners.py", line 118, in run
    return self._loop.run_until_complete(task)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "uvloop/loop.pyx", line 1517, in uvloop.loop.Loop.run_until_complete
  File "/opt/anaconda3/envs/od/lib/python3.12/site-packages/uvicorn/server.py", line 69, in serve
    await self._serve(sockets)
  File "/opt/anaconda3/envs/od/lib/python3.12/site-packages/uvicorn/server.py", line 76, in _serve
    config.load()
  File "/opt/anaconda3/envs/od/lib/python3.12/site-packages/uvicorn/config.py", line 433, in load
    self.loaded_app = import_from_string(self.app)
                      ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/opt/anaconda3/envs/od/lib/python3.12/site-packages/uvicorn/importer.py", line 22, in import_from_string
    raise exc from None
  File "/opt/anaconda3/envs/od/lib/python3.12/site-packages/uvicorn/importer.py", line 19, in import_from_string
    module = importlib.import_module(module_str)
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/opt/anaconda3/envs/od/lib/python3.12/importlib/__init__.py", line 90, in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "<frozen importlib._bootstrap>", line 1387, in _gcd_import
  File "<frozen importlib._bootstrap>", line 1360, in _find_and_load
  File "<frozen importlib._bootstrap>", line 1331, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 935, in _load_unlocked
  File "<frozen importlib._bootstrap_external>", line 995, in exec_module
  File "<frozen importlib._bootstrap>", line 488, in _call_with_frames_removed
  File "/Volumes/ExtremeSSD/OpenDevin/opendevin/server/listen.py", line 13, in <module>
    import agenthub  # noqa F401 (we import this to get the agents registered)
    ^^^^^^^^^^^^^^^
  File "/Volumes/ExtremeSSD/OpenDevin/agenthub/__init__.py", line 3, in <module>
    from opendevin.controller.agent import Agent
  File "/Volumes/ExtremeSSD/OpenDevin/opendevin/controller/__init__.py", line 1, in <module>
    from .action_manager import ActionManager
  File "/Volumes/ExtremeSSD/OpenDevin/opendevin/controller/action_manager.py", line 5, in <module>
    from opendevin.events.action import (
  File "/Volumes/ExtremeSSD/OpenDevin/opendevin/events/action/__init__.py", line 17, in <module>
    from .files import FileReadAction, FileWriteAction
  File "/Volumes/ExtremeSSD/OpenDevin/opendevin/events/action/files.py", line 14, in <module>
    from opendevin.runtime import E2BBox
  File "/Volumes/ExtremeSSD/OpenDevin/opendevin/runtime/__init__.py", line 3, in <module>
    from .docker.ssh_box import DockerSSHBox
  File "/Volumes/ExtremeSSD/OpenDevin/opendevin/runtime/docker/ssh_box.py", line 12, in <module>
    from pexpect import pxssh

ERROR:root:<class 'ModuleNotFoundError'>: No module named 'pexpect'

I have posted a question on backend issue here

OpenDevin/OpenDevin#1472

@Inductiv3D
Copy link

Inductiv3D commented May 12, 2024

@Orizune change 'export' to 'set' on windows

export OPENAI_API_KEY={your key}

'export' is not recongnized as as intern command (i'm in windows)

@rgtourism
Copy link

can somebody give me proper and latest installation steps.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment