问题
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