2

I was trying to install Mujoco and run a simple script which is :

import gym # openAi gym
from gym import envs
env_name = 'InvertedDoublePendulum-v2'
env = gym.make(env_name)
env.reset()
for _ in range(1000):
    env.render()
    env.step(env.action_space.sample()) # take a random action
env.close()

However i encountered the following error: "C:\Program Files (x86)\Microsoft Visual Studio\2019\BuildTools\VC\Tools\MSVC\14.29.30133\bin\HostX86\x64\cl.exe' failed with exit code 2"

Python version: 3.7.4 gym version: 0.21.0

I had downloaded the microsoft visual studio build tools 2019 and restarted the system but doesn't seem to help. Any help is appreciated.

Yeo Wei jie
  • 81
  • 1
  • 3

1 Answers1

0

You probably missing Visual Studion Build Tools (it's an extra command-line toolset you need to install)

https://visualstudio.microsoft.com/downloads/#build-tools-for-visual-studio-2019

EDIT:

based on a thread found here you should set this:

INCLUDE="C:\Program Files (x86)\Windows Kits0\Include\10.0.19041.0\ucrt"
LIB="C:\Program Files (x86)\Windows Kits0\Lib\10.0.19041.0\um\x86;C:\Program Files (x86)\Windows Kits0\Lib\10.0.19041.0\ucrt\x86"
set INCLUDE="C:\Program Files (x86)\Windows Kits0\Include\10.0.19041.0\ucrt"

set LIB="C:\Program Files (x86)\Windows Kits0\Lib\10.0.19041.0\um\x86;C:\Program Files (x86)\Windows Kits0\Lib\10.0.19041.0\ucrt\x86"
  • 1
    I tried this, but however, it gave me this following error instead: "Microsoft Visual C++ 14.0 or greater is required." which is weird since i already have 2022 version installed and it is 14.30 version. – Yeo Wei jie Dec 29 '21 at 16:30
  • 1
    Hi, did you solved your problem? I'm having the same issue and I'll appreciate your help – Rodrigo Reyes Apr 20 '22 at 22:20