3

When I import universe module from openAI. I get the following error.

Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/home/kunal/Desktop/OpenAi/openAI/lib/python3.7/site-packages/universe/__init__.py", line 22, in <module>
    from universe import error, envs
  File "/home/kunal/Desktop/OpenAi/openAI/lib/python3.7/site-packages/universe/envs/__init__.py", line 1, in <module>
    import universe.envs.vnc_env
  File "/home/kunal/Desktop/OpenAi/openAI/lib/python3.7/site-packages/universe/envs/vnc_env.py", line 11, in <module>
    from universe.envs import diagnostics
  File "/home/kunal/Desktop/OpenAi/openAI/lib/python3.7/site-packages/universe/envs/diagnostics.py", line 94
    async = self.qr_pool.apply_async(self.method, (self._last_img, time.time(), available_at))
      ^
SyntaxError: invalid syntax

Why am I getting this? and how can I solve this?

martineau
  • 119,623
  • 25
  • 170
  • 301
  • 3
    `async` was made into a keyword to support [coroutines](https://docs.python.org/3/reference/compound_stmts.html#coroutines) in Python 3.5, so from the little code shown in your question, it looks like it may be due to an attempt to run older code with a newer version of the interpreter. – martineau Jan 25 '19 at 21:32

1 Answers1

1

On Ubuntu 16.04 and 18.04:

sudo apt-get install -y libglu1-mesa-dev libgl1-mesa-dev libosmesa6-dev xvfb ffmpeg curl patchelf libglfw3 libglfw3-dev cmake zlib1g zlib1g-dev swig

After that reinstall the gym using:

git clone https://github.com/openai/gym.git
cd gym
pip install -e .
DanielM
  • 3,598
  • 5
  • 37
  • 53