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 on Windows #142

Closed
PierrunoYT opened this issue Mar 25, 2024 · 16 comments
Closed

Bug on Windows #142

PierrunoYT opened this issue Mar 25, 2024 · 16 comments
Labels
bug Something isn't working

Comments

@PierrunoYT
Copy link
Contributor

I runned this but it did not worked.

Step 1: Set up the OpenAI API key

  1. Sign in to OpenAI or create an account at https://openai.com/
  2. Navigate to https://platform.openai.com/account/api-keys
  3. Click "Create new secret key"
  4. Copy the generated API key

Step 2: Create a project folder

  1. Create a new folder for your OpenDevin project, e.g., C:\opendevin

Step 3: Create a virtual environment

  1. Open the Windows command prompt (cmd.exe)
  2. Navigate to your project folder: cd C:\opendevin
  3. Create a new virtual environment with venv: python -m venv env

Step 4: Activate the virtual environment

  1. Activate the virtual environment: env\Scripts\activate

Step 5: Set environment variables

  1. Set the OPENAI_API_KEY environment variable: set OPENAI_API_KEY=your_api_key_here
  2. Set the WORKSPACE_DIR environment variable: set WORKSPACE_DIR=C:\opendevin

Step 6: Install dependencies

  1. Install the Python dependencies: python -m pip install -r requirements.txt

Step 7: Start the backend

  1. Start the OpenDevin backend: uvicorn opendevin.server.listen:app --port 3000

Step 8: Start the frontend (new terminal)

  1. Open a new command prompt
  2. Navigate to the frontend folder: cd C:\opendevin\frontend
  3. Install the Node.js dependencies: npm install
  4. Start the frontend: npm run start -- --port 3001

You can now access OpenDevin at http://localhost:3001 in your browser.

Remember to deactivate the virtual environment when you're done by typing deactivate in the command prompt.

@PierrunoYT PierrunoYT added the bug Something isn't working label Mar 25, 2024
@jannikwinghart
Copy link
Contributor

What exactly do you mean with "did not work"? Which step didn't work? Did you get any error message?

@PierrunoYT
Copy link
Contributor Author

PierrunoYT commented Mar 25, 2024

After I runned front and backend some error was throwing up like maybe something with Docker? I used this steps above from the readme but I added the venv and set it for Windows.

@PierrunoYT
Copy link
Contributor Author

Can I contact you somehow?

@ha-zhcool
Copy link

There is an issue with the tag of the docker image. The script is looking for the :latest image while it's not labeled as is on docker hub.
To fix the issue, you just have to point the script to the correct image.

  1. Open file opendevin/sandbox/sandbox.py
  2. locate the image name "opendevin/sandbox:latest"
  3. replace with "opendevin/sandbox:v0.1"
  4. restart the backend.

@PierrunoYT
Copy link
Contributor Author

There is an issue with the tag of the docker image. The script is looking for the :latest image while it's not labeled as is on docker hub. To fix the issue, you just have to point the script to the correct image.

1. Open file opendevin/sandbox/sandbox.py

2. locate the image name "opendevin/sandbox:latest"

3. replace with "opendevin/sandbox:v0.1"

4. restart the backend.

The readme is missing content because there is nothing written that you need to use Docker

@ha-zhcool
Copy link

There is an issue with the tag of the docker image. The script is looking for the :latest image while it's not labeled as is on docker hub. To fix the issue, you just have to point the script to the correct image.

1. Open file opendevin/sandbox/sandbox.py

2. locate the image name "opendevin/sandbox:latest"

3. replace with "opendevin/sandbox:v0.1"

4. restart the backend.

The readme is missing content because there is nothing written that you need to use Docker

I'm just a standard user of the project that faced the same issue and willing to help

@PierrunoYT
Copy link
Contributor Author

There is an issue with the tag of the docker image. The script is looking for the :latest image while it's not labeled as is on docker hub. To fix the issue, you just have to point the script to the correct image.

1. Open file opendevin/sandbox/sandbox.py

2. locate the image name "opendevin/sandbox:latest"

3. replace with "opendevin/sandbox:v0.1"

4. restart the backend.

The readme is missing content because there is nothing written that you need to use Docker

I'm just a standard user of the project that faced the same issue and willing to help

Ah okay I got it. Thank you.

@PierrunoYT
Copy link
Contributor Author

What exactly do you mean with "did not work"? Which step didn't work? Did you get any error message?

Can I make a Discord Server for it?

@gujian2git
Copy link

uvicorn opendevin.server.listen:app --port 3000
Traceback (most recent call last):
File "D:\AppData\Program\anaconda3\lib\runpy.py", line 197, in _run_module_as_main
return _run_code(code, main_globals, None,
File "D:\AppData\Program\anaconda3\lib\runpy.py", line 87, in run_code
exec(code, run_globals)
File "D:\AppData\Program\anaconda3\Scripts\uvicorn.exe_main
.py", line 7, in
sys.exit(main())
File "D:\AppData\Program\anaconda3\lib\site-packages\click\core.py", line 1128, in call
return self.main(*args, **kwargs)
File "D:\AppData\Program\anaconda3\lib\site-packages\click\core.py", line 1053, in main
rv = self.invoke(ctx)
File "D:\AppData\Program\anaconda3\lib\site-packages\click\core.py", line 1395, in invoke
return ctx.invoke(self.callback, **ctx.params)
File "D:\AppData\Program\anaconda3\lib\site-packages\click\core.py", line 754, in invoke
return __callback(*args, **kwargs)
File "D:\AppData\Program\anaconda3\lib\site-packages\uvicorn\main.py", line 409, in main
run(
File "D:\AppData\Program\anaconda3\lib\site-packages\uvicorn\main.py", line 575, in run
server.run()
File "D:\AppData\Program\anaconda3\lib\site-packages\uvicorn\server.py", line 65, in run
return asyncio.run(self.serve(sockets=sockets))
File "D:\AppData\Program\anaconda3\lib\asyncio\runners.py", line 44, in run
return loop.run_until_complete(main)
File "D:\AppData\Program\anaconda3\lib\asyncio\base_events.py", line 647, in run_until_complete
return future.result()
File "D:\AppData\Program\anaconda3\lib\site-packages\uvicorn\server.py", line 69, in serve
await self._serve(sockets)
File "D:\AppData\Program\anaconda3\lib\site-packages\uvicorn\server.py", line 76, in serve
config.load()
File "D:\AppData\Program\anaconda3\lib\site-packages\uvicorn\config.py", line 433, in load
self.loaded_app = import_from_string(self.app)
File "D:\AppData\Program\anaconda3\lib\site-packages\uvicorn\importer.py", line 19, in import_from_string
module = importlib.import_module(module_str)
File "D:\AppData\Program\anaconda3\lib\importlib_init
.py", line 127, in import_module
return _bootstrap._gcd_import(name[level:], package, level)
File "", line 1030, in _gcd_import
File "", line 1007, in _find_and_load
File "", line 986, in _find_and_load_unlocked
File "", line 680, in _load_unlocked
File "", line 850, in exec_module
File "", line 228, in call_with_frames_removed
File "D:\Admin\ForWork\2024\MyCode\Python\FromGit\OpenDevin\opendevin\server\listen.py", line 1, in
from opendevin.server.session import Session
File "D:\Admin\ForWork\2024\MyCode\Python\FromGit\OpenDevin\opendevin\server\session.py", line 8, in
from opendevin.controller import AgentController
File "D:\Admin\ForWork\2024\MyCode\Python\FromGit\OpenDevin\opendevin\controller_init
.py", line 19, in
from .command_manager import CommandManager
File "D:\Admin\ForWork\2024\MyCode\Python\FromGit\OpenDevin\opendevin\controller\command_manager.py", line 4, in
from opendevin.sandbox.sandbox import DockerInteractive
File "D:\Admin\ForWork\2024\MyCode\Python\FromGit\OpenDevin\opendevin\sandbox\sandbox.py", line 16, in
class DockerInteractive:
File "D:\Admin\ForWork\2024\MyCode\Python\FromGit\OpenDevin\opendevin\sandbox\sandbox.py", line 20, in DockerInteractive
workspace_dir: str | None = None,
TypeError: unsupported operand type(s) for |: 'type' and 'NoneType'

@enyst
Copy link
Collaborator

enyst commented Mar 26, 2024

workspace_dir: str | None = None,
TypeError: unsupported operand type(s) for |: 'type' and 'NoneType'

What version of python are you using? This syntax has been introduced in 3.10. https://docs.python.org/3/whatsnew/3.10.html

@rbren
Copy link
Collaborator

rbren commented Mar 26, 2024

Looks like we've documented the need for latest python and for docker. Going to close this one, but let us know if you need more help!

@rbren rbren closed this as completed Mar 26, 2024
@gujian2git
Copy link

workspace_dir: str | None = None,
TypeError: unsupported operand type(s) for |: 'type' and 'NoneType'

What version of python are you using? This syntax has been introduced in 3.10. https://docs.python.org/3/whatsnew/3.10.html

Python version 3.12.2,I have changed Python version to 3.10,the exception still exists;

@rbren
Copy link
Collaborator

rbren commented Mar 28, 2024

Hrmm. That error message is almost always an indication of an old python version. I wonder if uvicorn is using an old version of python somewhere on your machine?

What does uvicorn --version show? I get

Running uvicorn 0.29.0 with CPython 3.12.2 on Linux

@PierrunoYT
Copy link
Contributor Author

Hrmm. That error message is almost always an indication of an old python version. I wonder if uvicorn is using an old version of python somewhere on your machine?

What does uvicorn --version show? I get

Running uvicorn 0.29.0 with CPython 3.12.2 on Linux

I get this C:\Users\pierr>uvicorn --version
Running uvicorn 0.29.0 with CPython 3.10.11 on Windows

@rbren
Copy link
Collaborator

rbren commented Mar 28, 2024

Very strange. I'm totally unable to reproduce. Granted I'm on Linux, but it shouldn't really matter--it's a python typing error.

❯ /home/rbren/.asdf/installs/python/3.10.11/bin/uvicorn --version
Running uvicorn 0.29.0 with CPython 3.10.11 on Linux

❯ /home/rbren/.asdf/installs/python/3.10.11/bin/uvicorn opendevin.server.listen:app --port 3000
INFO:     Started server process [2153603]
INFO:     Waiting for application startup.
INFO:     Application startup complete.
INFO:     Uvicorn running on http://127.0.0.1:3000 (Press CTRL+C to quit)

Everything I'm seeing online is cases of "I thought it was running python 3.10, but it turned out it was linking into an old version."

Maybe try reinstalling python, uvicorn, or pip install --upgrade --force-reinstall -r requirements.txt.

@abdullah-az
Copy link

(env) PS C:\opendevin> python -m pip install -r requirements.txt
ERROR: Could not open requirements file: [Errno 2] No such file or directory: 'requirements.txt'

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

7 participants