Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Bug]: "make run" results in "ModuleNotFoundError: No module named 'opendevin'" #1348

Open
2 tasks done
Yn8en opened this issue Apr 24, 2024 · 6 comments
Open
2 tasks done
Labels
bug Something isn't working severity:low Minor issues, code cleanup, etc

Comments

@Yn8en
Copy link

Yn8en commented Apr 24, 2024

Is there an existing issue for the same bug?

Describe the bug

Hey Guys,
after having a successful build in WSL (poetry install, poetry shell make build) ...

executing "make run" command results in the below described error:
ModuleNotFoundError: No module named 'opendevin'

Current Version

Just pulled the repo freshly today, this morning
Commit: 3eea6de / Branch: main

Installation and Configuration > Reproduction Steps

I use bash > WSL (ubuntu) with all dependencies installed.

> wsl

... ubuntu used, all requirements installed (node, python, npm, pipx, poetry, ...)
... "make build" passes all tests

> poetry install
> poetry shell
> make build 

----- resulting in ------------------------------------------------------------

Build using "make build" was successful:
> opendevin-frontend@0.1.0 build
> tsc && vite build

vite v5.2.8 building for production...
✓ 1319 modules transformed.
dist/index.html                         2.00 kB │ gzip:   0.93 kB
dist/assets/index-BFv3DKUU.css        180.42 kB │ gzip:  21.91 kB
dist/assets/web-vitals-BA3w2fPb.js      4.31 kB │ gzip:   1.68 kB
dist/assets/index-jwUbCSUE.js       1,080.03 kB │ gzip: 319.22 kB

(!) Some chunks are larger than 500 kB after minification. Consider:
- Using dynamic import() to code-split the application
- Use build.rollupOptions.output.manualChunks to improve chunking: https://rollupjs.org/configuration-options/#output-manualchunks
- Adjust chunk size limit for this warning via build.chunkSizeWarningLimit.
✓ built in 21.23s
Build completed successfully.

make setup-config

----- resulting in -------- config.toml ---------------------------------------

LLM_MODEL="gpt-3.5-turbo-1106"
LLM_API_KEY="sk-***"
LLM_EMBEDDING_MODEL=""
WORKSPACE_BASE="/mnt/p/Projects/MyWorkspaceFolder"

make run

----- resulting in ------------------------------------------------------------

myawesomename@myawesome-PC:/mnt/p/Projects/OpenDevin$ make run
Running the app...
Starting backend server...
Waiting for the backend to start...
Traceback (most recent call last):
  File "/mnt/p/Projects/OpenDevin/.venv/bin/uvicorn", line 8, in <module>
    sys.exit(main())
             ^^^^^^
  File "/mnt/p/Projects/OpenDevin/.venv/lib/python3.11/site-packages/click/core.py", line 1157, in __call__
    return self.main(*args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/mnt/p/Projects/OpenDevin/.venv/lib/python3.11/site-packages/click/core.py", line 1078, in main
    rv = self.invoke(ctx)
         ^^^^^^^^^^^^^^^^
  File "/mnt/p/Projects/OpenDevin/.venv/lib/python3.11/site-packages/click/core.py", line 1434, in invoke
    return ctx.invoke(self.callback, **ctx.params)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/mnt/p/Projects/OpenDevin/.venv/lib/python3.11/site-packages/click/core.py", line 783, in invoke
    return __callback(*args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/mnt/p/Projects/OpenDevin/.venv/lib/python3.11/site-packages/uvicorn/main.py", line 409, in main
    run(
  File "/mnt/p/Projects/OpenDevin/.venv/lib/python3.11/site-packages/uvicorn/main.py", line 575, in run
    server.run()
  File "/mnt/p/Projects/OpenDevin/.venv/lib/python3.11/site-packages/uvicorn/server.py", line 65, in run
    return asyncio.run(self.serve(sockets=sockets))
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.11/asyncio/runners.py", line 190, in run
    return runner.run(main)
           ^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.11/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 "/mnt/p/Projects/OpenDevin/.venv/lib/python3.11/site-packages/uvicorn/server.py", line 69, in serve
    await self._serve(sockets)
  File "/mnt/p/Projects/OpenDevin/.venv/lib/python3.11/site-packages/uvicorn/server.py", line 76, in _serve
    config.load()
  File "/mnt/p/Projects/OpenDevin/.venv/lib/python3.11/site-packages/uvicorn/config.py", line 433, in load
    self.loaded_app = import_from_string(self.app)
                      ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/mnt/p/Projects/OpenDevin/.venv/lib/python3.11/site-packages/uvicorn/importer.py", line 22, in import_from_string
    raise exc from None
  File "/mnt/p/Projects/OpenDevin/.venv/lib/python3.11/site-packages/uvicorn/importer.py", line 19, in import_from_string
    module = importlib.import_module(module_str)
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.11/importlib/__init__.py", line 126, in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "<frozen importlib._bootstrap>", line 1204, in _gcd_import
  File "<frozen importlib._bootstrap>", line 1176, in _find_and_load
  File "<frozen importlib._bootstrap>", line 1126, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 241, in _call_with_frames_removed
  File "<frozen importlib._bootstrap>", line 1204, in _gcd_import
  File "<frozen importlib._bootstrap>", line 1176, in _find_and_load
  File "<frozen importlib._bootstrap>", line 1126, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 241, in _call_with_frames_removed
  File "<frozen importlib._bootstrap>", line 1204, in _gcd_import
  File "<frozen importlib._bootstrap>", line 1176, in _find_and_load
  File "<frozen importlib._bootstrap>", line 1140, in _find_and_load_unlocked
ModuleNotFoundError: No module named 'opendevin'

interrupting ctrl+c leads to:

^Cmake: *** [Makefile:176: run] Interrupt

... so the error clearly happens somewhere inside execution of Line 177 in the "Makefile"

@poetry run uvicorn opendevin.server.listen:app --port $(BACKEND_PORT) &

Model and Agent

no agents chosen, didnt arrive there yet i guess.

> config.toml see above
@Yn8en Yn8en added the bug Something isn't working label Apr 24, 2024
@rbren
Copy link
Collaborator

rbren commented Apr 24, 2024

@Yn8en try setting PYTHONPATH=$(pwd) in your env

@Yn8en
Copy link
Author

Yn8en commented Apr 24, 2024

thanks for the fast reply, i just tried as you suggested:

myawesomename@myawesome-PC:/mnt/p/Projects/OpenDevin$ export PYTHONPATH=$(pwd)
myawesomename@myawesome-PC:/mnt/p/Projects/OpenDevin$ make run

... results in the exact same behaviour!

@SmartManoj
Copy link
Contributor

Could you share the log of make build?

@Yn8en
Copy link
Author

Yn8en commented Apr 25, 2024

Update still regarding the same issue:
I did a fresh install of ubuntu WSL over again, going the following sequence of steps:

# unregister ubuntu distro in WSL and reinstall freshly
wsl --unregister ubuntu
wsl --install -d Ubuntu
exit
wsl --set-default Ubuntu
#open bash in VScode
wsl
cd /mnt/p/Projects/OpenDevin
        > me@My-PC:/mnt/p/Projects/OpenDevin$


## basic setup
sudo apt update
sudo apt upgrade -y
sudo apt install make
sudo apt install build-essential -y


#installing python and setting python symlink for python 3.11
sudo add-apt-repository ppa:deadsnakes/ppa
sudo apt install python3.11
sudo ln -s /usr/bin/python3.11 /usr/bin/python
python -V
    > Python 3.11.9
python3.11 -V
    > Python 3.11.9


#install Node
sudo apt install nodejs -y
node --version
    > v12.22.9


#installing & activating nvm >> https://github.com/nvm-sh/nvm#installing-and-updating
curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.7/install.sh | bash
export NVM_DIR="$HOME/.nvm"
[ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh"  # This loads nvm
[ -s "$NVM_DIR/bash_completion" ] && \. "$NVM_DIR/bash_completion"  # This loads nvm bash_completion
command -v nvm
    > nvm


#update3 node to v20.12.2
nvm install --lts
    > Now using node v20.12.2 (npm v10.5.0)
nvm use v20.12.2
    > Now using node v20.12.2 (npm v10.5.0)

#install pip and poetry
sudo apt install python3-pip -y
pip install poetry
export PATH="$HOME/.local/bin:$PATH"
poetry -V
    > Poetry (version 1.8.2)
poetry config virtualenvs.in-project true

----------- WSL UBUNTU PREPARATION COMPLETE ------------

#pulled latest commit from OpenDevin
    branch: MAIN
    commit: c45e2ae


#go to OpenDevin Folder and activate venv
poetry env use python3.11
    > (opendevin-py3.11) me@My-PC:/mnt/p/Projects/OpenDevin$
poetry shell
poetry install
#build
make build
    .. or
make build > build.log 2>&1
    (see build.log ...)
    ✓ built in 21.71s
    Build completed successfully.
#setup config
make setup-config
    LLM_MODEL="gpt-3.5-turbo-1106"
    LLM_API_KEY="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"
    LLM_EMBEDDING_MODEL=""
    WORKSPACE_BASE="/mnt/p/Projects/VERGIL-OpenDevin"
#run
make run
    .. or
make run > run.log 2>&1
    (see run.log ...)
    > ModuleNotFoundError: No module named 'opendevin'

build.log
run.log

@SmartManoj
Copy link
Contributor

#584 (comment)

@Yn8en
Copy link
Author

Yn8en commented Apr 26, 2024

thanks for the info, i gonna look into it later and come back with what i got

@rbren rbren added the severity:low Minor issues, code cleanup, etc label May 2, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working severity:low Minor issues, code cleanup, etc
Projects
None yet
Development

No branches or pull requests

3 participants