0

While importing openai's universe, i get these errors:

Traceback (most recent call last):
  File "/Users/calvin/Desktop/universe-test/main.py", line 2, in <module>
    import universe
  File "/Users/calvin/universe/universe/__init__.py", line 22, in <module>
    from universe import error, envs
  File "/Users/calvin/universe/universe/envs/__init__.py", line 1, in <module>
    import universe.envs.vnc_env
  File "/Users/calvin/universe/universe/envs/vnc_env.py", line 11, in <module>
    from universe.envs import diagnostics
  File "/Users/calvin/universe/universe/envs/diagnostics.py", line 94
    async = self.qr_pool.apply_async(self.method, (self._last_img, time.time(), available_at))
          ^
SyntaxError: invalid syntax

I've tried downloading a different version of gym, reinstalling universe, and nothing works. I have python 3.8.5 64-bit. My operating system is macOS Catalina 10.15.6. Any ideas?

1 Answers1

0

async is now a special keyword, and as such, can't be used as a variable name.

That library appears to be made for Python pre-3.5. I believe your only options are:

  • Use a older version of Python 3 (async was intrduced in 3.5).
  • Edit the local copy of the library file to change the name to something else.
  • Check to see if there are any updates/forks to the library that fix that issue.
Carcigenicate
  • 43,494
  • 9
  • 68
  • 117
  • Awesome! this solved the problem! For anyone else with this problem, download python 3.5.0. It works! –  Aug 12 '20 at 15:06