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

MicroRTS-Py installation failing #90

Open
marcelo-lemos opened this issue Mar 1, 2023 · 10 comments · Fixed by #92
Open

MicroRTS-Py installation failing #90

marcelo-lemos opened this issue Mar 1, 2023 · 10 comments · Fixed by #92

Comments

@marcelo-lemos
Copy link

Hi,
I've encountered an issue when trying to install MicroRTS-Py in the last few days.
When running poetry install, I get the following exception:

• Installing gym (0.21.0): Failed

  CalledProcessError

  Command '['/home/marcelo/.pyenv/versions/3.9.15/envs/microrts-py-test/bin/python', '-m', 'pip', 'install', '--use-pep517', '--disable-pip-version-check', '--prefix', '/home/marcelo/.pyenv/versions/3.9.15/envs/microrts-py-test', '--no-deps', '/home/marcelo/.cache/pypoetry/artifacts/a9/c8/ae/d0a65375458271c58575e7e37f2e1b64874bb89e5ff06ad8bfbd3a23ec/gym-0.21.0.tar.gz']' returned non-zero exit status 1.

  at ~/.pyenv/versions/3.9.15/lib/python3.9/subprocess.py:528 in run
       524│             # We don't call process.wait() as .__exit__ does that for us.
       525│             raise
       526│         retcode = process.poll()
       527│         if check and retcode:
    →  528│             raise CalledProcessError(retcode, process.args,
       529│                                      output=stdout, stderr=stderr)
       530│     return CompletedProcess(process.args, retcode, stdout, stderr)
       531│ 
       532│ 

The following error occurred when trying to handle this error:


  EnvCommandError

  Command ['/home/marcelo/.pyenv/versions/3.9.15/envs/microrts-py-test/bin/python', '-m', 'pip', 'install', '--use-pep517', '--disable-pip-version-check', '--prefix', '/home/marcelo/.pyenv/versions/3.9.15/envs/microrts-py-test', '--no-deps', '/home/marcelo/.cache/pypoetry/artifacts/a9/c8/ae/d0a65375458271c58575e7e37f2e1b64874bb89e5ff06ad8bfbd3a23ec/gym-0.21.0.tar.gz'] errored with the following return code 1, and output: 
  Processing /home/marcelo/.cache/pypoetry/artifacts/a9/c8/ae/d0a65375458271c58575e7e37f2e1b64874bb89e5ff06ad8bfbd3a23ec/gym-0.21.0.tar.gz
    Installing build dependencies: started
    Installing build dependencies: finished with status 'done'
    Getting requirements to build wheel: started
    Getting requirements to build wheel: finished with status 'error'
    error: subprocess-exited-with-error
    
    × Getting requirements to build wheel did not run successfully.
    │ exit code: 1
    ╰─> [1 lines of output]
        error in gym setup command: 'extras_require' must be a dictionary whose values are strings or lists of strings containing valid project/version requirement specifiers.
        [end of output]
    
    note: This error originates from a subprocess, and is likely not a problem with pip.
  error: subprocess-exited-with-error
  
  × Getting requirements to build wheel did not run successfully.
  │ exit code: 1
  ╰─> See above for output.
  
  note: This error originates from a subprocess, and is likely not a problem with pip.
  

  at ~/.local/share/pypoetry/venv/lib/python3.9/site-packages/poetry/utils/env.py:1476 in _run
      1472│                 output = subprocess.check_output(
      1473│                     command, stderr=subprocess.STDOUT, env=env, **kwargs
      1474│                 )
      1475│         except CalledProcessError as e:
    → 1476│             raise EnvCommandError(e, input=input_)
      1477│ 
      1478│         return decode(output)
      1479│ 
      1480│     def execute(self, bin: str, *args: str, **kwargs: Any) -> int:

The following error occurred when trying to handle this error:


  PoetryException

  Failed to install /home/marcelo/.cache/pypoetry/artifacts/a9/c8/ae/d0a65375458271c58575e7e37f2e1b64874bb89e5ff06ad8bfbd3a23ec/gym-0.21.0.tar.gz

  at ~/.local/share/pypoetry/venv/lib/python3.9/site-packages/poetry/utils/pip.py:51 in pip_install
       47│ 
       48│     try:
       49│         return environment.run_pip(*args)
       50│     except EnvCommandError as e:
    →  51│         raise PoetryException(f"Failed to install {path.as_posix()}") from e
       52│ 

Seems like it might be related to this other issue openai/gym#3176 but I wasn't able to fix it.

Any ideas about what I can do to solve this problem?

@pseudo-rnd-thoughts
Copy link
Member

@vwxyzjn Setuptools updated which broke gym v0.21, do you know if it is possible to change microRTS to specify the setuptools?

@rahuldwivedi1112
Copy link

Was facing same issue, As a workaround pre installed gym 0.26.2 and updated pyproject.toml and poetry.lock. Would love to know if there is a fix available.

@adams199
Copy link

@rahuldwivedi1112 would you mind going into more detail on what you changed in pyproject.toml and poerty.lock to get the workaround to work? Thanks in advance

@vwxyzjn
Copy link
Collaborator

vwxyzjn commented May 10, 2023

It’s probably related to setup tools. See vwxyzjn/invalid-action-masking#9 (comment)

@rahuldwivedi1112
Copy link

rahuldwivedi1112 commented May 11, 2023

@rahuldwivedi1112 would you mind going into more detail on what you changed in pyproject.toml and poerty.lock to get the workaround to work? Thanks in advance

Seems like they pushed a fix. but this is what i did before

Poetry.lock
Line 310 : gym = ">=0.21.0,<0.22.0" --> gym = ">=0.21.0,<0.27.0"

line 592: version = "0.21.0" ---> version = "0.26.2"
Line 4651( may not need changing, if there is error then update the version to 26.2 and Sha256 string from the error message, i got this error when i used )
: {file = "gym-0.21.0.tar.gz", hash = "sha256:0fd1ce165c754b4017e37a617b097c032b8c3feb8a0394ccc8777c7c50dddff3"},

pyproject.toml:
line 16: gym = "^0.21.0" ---> gym = "^0.26.2"

@pseudo-rnd-thoughts
Copy link
Member

Be aware that there are significant API changes between 0.21 and 0.26, and will probably not work out of the box

@vwxyzjn
Copy link
Collaborator

vwxyzjn commented May 20, 2023

Hi all could you give the latest master a try?

@Danroandro
Copy link

Good news, the hello_world.py works without any problems, when I try to train an agent with 'python ppo_gridnet.py' I get this error.
image

@vwxyzjn
Copy link
Collaborator

vwxyzjn commented May 23, 2023

Try pulling the master branch. You might be running an earlier version of the master.

@vwxyzjn
Copy link
Collaborator

vwxyzjn commented May 23, 2023

https://asciinema.org/a/586754 shows my installation end-to-end

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

6 participants