Why am I getting “invalid syntax” error while importing universe module from openAI

人盡茶涼 提交于 2021-02-09 09:51:36

问题


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?


回答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 .


来源:https://stackoverflow.com/questions/54372092/why-am-i-getting-invalid-syntax-error-while-importing-universe-module-from-ope

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!