OpenHands icon indicating copy to clipboard operation
OpenHands copied to clipboard

Make `make` fail with a good error message when npm or python have incompatible versions

Open abhawan888 opened this issue 1 year ago • 16 comments

Summary

Windows 11 WSL2 Ubuntu 20.04

System:~/OpenDevin$ make build Building project... Pulling Docker image... Using default tag: latest latest: Pulling from opendevin/sandbox Digest: sha256:486e3da1d7c8ec54a2e3269071eed9b91bc75b82ca5d1ac1760d33883c39e575 Status: Image is up to date for ghcr.io/opendevin/sandbox:latest ghcr.io/opendevin/sandbox:latest

What's Next? View a summary of image vulnerabilities and recommendations → docker scout quickview ghcr.io/opendevin/sandbox Installing Python dependencies... make: python: No such file or directory make: *** [Makefile:17: build] Error 127

abhawan888 avatar Apr 03 '24 03:04 abhawan888

Is Python in your PATH? What is the output of python --version?

yimothysu avatar Apr 03 '24 03:04 yimothysu

@abhawan888 this version of makefiel will be outdated we fixed all the issues in this PR #378 waiting just for the merge also you should have python 3.11 as version to build the project

anasdorbani avatar Apr 03 '24 03:04 anasdorbani

@dorbanianas Thanks! I have a fresh install and everything is the latest version. I'll keep an eye out for the merge. Really excited to give this a try.

abhawan888 avatar Apr 03 '24 03:04 abhawan888

@abhawan888 Sure it's just a matter of time 😉

anasdorbani avatar Apr 03 '24 03:04 anasdorbani

im new using ubuntu how can i use the command make to install OpenDevin? i don't quite understand what to do or how command "make" works

Jaitwo avatar Apr 03 '24 13:04 Jaitwo

@Jaitwo you can simply follow the steps in the readme and how make works just you define a file named Makefile where you give some shortcuts like build, install... Where the users of the project can run a lot of these commands using just the shortcut that you have defined, this is my definition of course to make it simple for you, Now how you can use it? just you need to go to the linux terminal and type make build to build the venv and install the dependencies, after that use make setup-config to setup your model config and finally make run to run the full project, you may encounter so bugs but we are working to fix them asap.

anasdorbani avatar Apr 03 '24 13:04 anasdorbani

edit "makefile" replace all "python" with "python3"

Ido108 avatar Apr 03 '24 18:04 Ido108

edit "makefile" replace all "python" with "python3"

make build is so far working, thank you.

dracoix avatar Apr 03 '24 19:04 dracoix

edit "makefile" replace all "python" with "python3"

make build is so far working, thank you.

Setting up frontend environment... /bin/sh: 1: npm: not found make: *** [Makefile:21: build] Error 127

back to square one I guess....

dracoix avatar Apr 03 '24 20:04 dracoix

okay so I also had to install npm in the environment itself

and it didn't make a difference.

ERROR: Failed connection to server. Please ensure the server is reachable at ws://127.0.0.1:3001/ws.

dracoix avatar Apr 03 '24 20:04 dracoix

@rbren @neubig what do you think about including the installation of python3.11 and npm in the make build?

anasdorbani avatar Apr 03 '24 20:04 anasdorbani

installing a full programming language is kind of aggressive for make 😅

IMO make shouldn't have system-wide side-effects, as much as possible

rbren avatar Apr 04 '24 02:04 rbren

Can we fail the make with a good error message if npm or python isn't installed or on an old version?

rbren avatar Apr 04 '24 03:04 rbren

Most of the compatibility work is done in the Makefile at https://github.com/OpenDevin/OpenDevin/pull/650

Regarding the node and npm version inspection, I believe it has been implemented in https://github.com/OpenDevin/OpenDevin/pull/659

xcodebuild avatar Apr 04 '24 06:04 xcodebuild

@rbren we can run the process in the background and show some good looking messages and wait for it until it finishes

anasdorbani avatar Apr 04 '24 09:04 anasdorbani

But I guess for now maybe it's not necessary because it will add more complexity and edge cases to handle that we are not supposed to think of right now

anasdorbani avatar Apr 04 '24 09:04 anasdorbani

now we handle check for python, npm, docker and for the pnpm if npm is installed the pnpm get enabled also added some styling 😅, more details here #634

anasdorbani avatar Apr 06 '24 01:04 anasdorbani