openai / procgen

Procgen Benchmark: Procedurally-Generated Game-Like Gym-Environments
https://openai.com/blog/procgen-benchmark/
MIT License
1.01k stars 209 forks source link

building procgen error #4

Closed dadhichi1 closed 4 years ago

dadhichi1 commented 4 years ago

Running in windows 10 !python -m procgen.interactive --env-name coinrun

building procgen... Traceback (most recent call last): File "C:\Users\dadhict\AppData\Local\Continuum\anaconda3\lib\runpy.py", line 193, in _run_module_as_main "main", mod_spec) File "C:\Users\dadhict\AppData\Local\Continuum\anaconda3\lib\runpy.py", line 85, in _run_code exec(code, run_globals) File "C:\Users\dadhict\Documents\GitHub\procgen\procgen\interactive.py", line 69, in main() File "C:\Users\dadhict\Documents\GitHub\procgen\procgen\interactive.py", line 64, in main ia = ProcgenInteractive(args.vision, env_name=args.env_name, kwargs) File "C:\Users\dadhict\Documents\GitHub\procgen\procgen\interactive.py", line 17, in init venv = ProcgenEnv(num_envs=1, kwargs) File "C:\Users\dadhict\Documents\GitHub\procgen\procgen\env.py", line 184, in init super().init(num_envs, env_name, options, *kwargs) File "C:\Users\dadhict\Documents\GitHub\procgen\procgen\env.py", line 91, in init lib_dir = build(debug=debug) File "C:\Users\dadhict\Documents\GitHub\procgen\procgen\build.py", line 109, in build p = run(configure_cmd) File "C:\Users\dadhict\Documents\GitHub\procgen\procgen\build.py", line 35, in run return sp.run(cmd, stdout=sp.PIPE, stderr=sp.STDOUT, encoding="utf8") File "C:\Users\dadhict\AppData\Local\Continuum\anaconda3\lib\subprocess.py", line 472, in run with Popen(popenargs, **kwargs) as process: File "C:\Users\dadhict\AppData\Local\Continuum\anaconda3\lib\subprocess.py", line 775, in init restore_signals, start_new_session) File "C:\Users\dadhict\AppData\Local\Continuum\anaconda3\lib\subprocess.py", line 1178, in _execute_child startupinfo) FileNotFoundError: [WinError 2] The system cannot find the file specified

christopherhesse commented 4 years ago

What's the output of cmake --version?

christopherhesse commented 4 years ago

Also where cmake

dadhichi1 commented 4 years ago

reinstalled cmake---post that--- !cmake --version !where cmake

cmake version 3.15.3 CMake suite maintained and supported by Kitware (kitware.com/cmake). C:\Users\dadhict\AppData\Local\Continuum\anaconda3\Scripts\cmake.exe

post that getting follwoing error: building procgen...RUN FAILED ['cmake', '-G', 'Visual Studio 15 2017 Win64', '-DCMAKE_PREFIX_PATH=C:\Users\dadhict\AppData\Local\Continuum\anaconda3\library\lib\cmake\Qt5;/usr/local/opt/qt5/lib/cmake', '../..']: CMake Error at CMakeLists.txt:2 (project): Generator

Visual Studio 15 2017 Win64

could not find any instance of Visual Studio.

-- Configuring incomplete, errors occurred! See also "C:/Users/dadhict/Documents/GitHub/procgen/procgen/.build/relwithdebinfo/CMakeFiles/CMakeOutput.log".

Traceback (most recent call last): File "C:\Users\dadhict\AppData\Local\Continuum\anaconda3\lib\runpy.py", line 193, in _run_module_as_main "main", mod_spec) File "C:\Users\dadhict\AppData\Local\Continuum\anaconda3\lib\runpy.py", line 85, in _run_code exec(code, run_globals) File "C:\Users\dadhict\Documents\GitHub\procgen\procgen\interactive.py", line 69, in main() File "C:\Users\dadhict\Documents\GitHub\procgen\procgen\interactive.py", line 64, in main ia = ProcgenInteractive(args.vision, env_name=args.env_name, kwargs) File "C:\Users\dadhict\Documents\GitHub\procgen\procgen\interactive.py", line 17, in init venv = ProcgenEnv(num_envs=1, kwargs) File "C:\Users\dadhict\Documents\GitHub\procgen\procgen\env.py", line 184, in init super().init(num_envs, env_name, options, **kwargs) File "C:\Users\dadhict\Documents\GitHub\procgen\procgen\env.py", line 91, in init lib_dir = build(debug=debug) File "C:\Users\dadhict\Documents\GitHub\procgen\procgen\build.py", line 116, in build check(p, verbose=package) File "C:\Users\dadhict\Documents\GitHub\procgen\procgen\build.py", line 41, in check raise Exception("failed to build procgen from source") Exception: failed to build procgen from source

dadhichi1 commented 4 years ago

Issue resolved, i was trying run from other directory, when i moved to the following directly my code is running. C:\Users\dadhict\Documents\GitHub\procgen\procgen

TheNeeloy commented 4 years ago

Hello,

I'm running into a similar problem when trying to build on Windows 10, with anaconda.

I first installed Visual Studio 2017 from scratch, with no additional modules chosen during the installation process.

Then, after cloning the repo, and running conda env update --name procgen --file environment.yml, the procgen environment is created.

When I activate the procgen env, I get a very long output, as shown here:

C:\Users\neelo\OneDrive\Documents\heist-marl>SET DISTUTILS_USE_SDK=1

C:\Users\neelo\OneDrive\Documents\heist-marl>SET MSSdk=1

C:\Users\neelo\OneDrive\Documents\heist-marl>SET platform=

C:\Users\neelo\OneDrive\Documents\heist-marl>IF /I [AMD64] == [amd64] set "platform=true"

C:\Users\neelo\OneDrive\Documents\heist-marl>IF /I [] == [amd64] set "platform=true"

C:\Users\neelo\OneDrive\Documents\heist-marl>if defined platform (set "VSREGKEY=HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Microsoft\VisualStudio\14.0" )  ELSE (set "VSREGKEY=HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\VisualStudio\14.0" )

C:\Users\neelo\OneDrive\Documents\heist-marl>for /F "skip=2 tokens=2,*" %A in ('reg query "HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Microsoft\VisualStudio\14.0" /v InstallDir') do SET "VSINSTALLDIR=%B"
ERROR: The system was unable to find the specified registry key or value.

C:\Users\neelo\OneDrive\Documents\heist-marl>if "C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\" == "" (set "VSINSTALLDIR=" )

C:\Users\neelo\OneDrive\Documents\heist-marl>if "C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\" == "" (
ECHO "WARNING: Did not find VS in registry or in VS140COMNTOOLS env var - your compiler may not work"
 GOTO End
)

C:\Users\neelo\OneDrive\Documents\heist-marl>echo "Found VS2014 at C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\"
"Found VS2014 at C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\"

C:\Users\neelo\OneDrive\Documents\heist-marl>SET "VS_VERSION=14.0"

C:\Users\neelo\OneDrive\Documents\heist-marl>SET "VS_MAJOR=14"

C:\Users\neelo\OneDrive\Documents\heist-marl>SET "VS_YEAR=2015"

C:\Users\neelo\OneDrive\Documents\heist-marl>set "MSYS2_ARG_CONV_EXCL=/AI;/AL;/OUT;/out"

C:\Users\neelo\OneDrive\Documents\heist-marl>set "MSYS2_ENV_CONV_EXCL=CL"

C:\Users\neelo\OneDrive\Documents\heist-marl>set "PY_VCRUNTIME_REDIST=\vcruntime140.dll"

C:\Users\neelo\OneDrive\Documents\heist-marl>set "CFLAGS= -MD -GL -MD -GL"

C:\Users\neelo\OneDrive\Documents\heist-marl>set "CXXFLAGS= -MD -GL -MD -GL"

C:\Users\neelo\OneDrive\Documents\heist-marl>set "LDFLAGS_SHARED= -LTCG ucrt.lib -LTCG ucrt.lib"

C:\Users\neelo\OneDrive\Documents\heist-marl>set "CXX=cl.exe"

C:\Users\neelo\OneDrive\Documents\heist-marl>set "CC=cl.exe"

C:\Users\neelo\OneDrive\Documents\heist-marl>IF /I [amd64] == [win-64] (set "folder=x64" )  else (set "folder=x86" )

C:\Users\neelo\OneDrive\Documents\heist-marl>for /F "tokens=*" %I in ('dir "C:\Program Files (x86)\Windows Kits\*1*" /B /O:N') do for %A in (%~I) do if "%A" == "8.1" set win=%A

C:\Users\neelo\OneDrive\Documents\heist-marl>for %A in (10) do if "%A" == "8.1" set win=%A

C:\Users\neelo\OneDrive\Documents\heist-marl>if "10" == "8.1" set win=10

C:\Users\neelo\OneDrive\Documents\heist-marl>for %A in (8.1) do if "%A" == "8.1" set win=%A

C:\Users\neelo\OneDrive\Documents\heist-marl>if "8.1" == "8.1" set win=8.1

C:\Users\neelo\OneDrive\Documents\heist-marl>for /F "tokens=*" %I in ('dir "C:\Program Files (x86)\Windows Kits\*1*" /B /O:N') do for %A in (%~I) do if "%A" == "10" set win=%A

C:\Users\neelo\OneDrive\Documents\heist-marl>for %A in (10) do if "%A" == "10" set win=%A

C:\Users\neelo\OneDrive\Documents\heist-marl>if "10" == "10" set win=10

C:\Users\neelo\OneDrive\Documents\heist-marl>for %A in (8.1) do if "%A" == "10" set win=%A

C:\Users\neelo\OneDrive\Documents\heist-marl>if "8.1" == "10" set win=8.1

C:\Users\neelo\OneDrive\Documents\heist-marl>setlocal enabledelayedexpansion

C:\Users\neelo\OneDrive\Documents\heist-marl>if "10" == "10" (
for /F "tokens=*" %I in ('dir "C:\Program Files (x86)\Windows Kits\10\bin\10*" /B /O:N') do for %A in (%~I) do set last=%A
 set "sdk_bin_path=C:\Program Files (x86)\Windows Kits\10\bin\!last!\x86"
)  else (set "sdk_bin_path=C:\Program Files (x86)\Windows Kits\8.1\bin\x86" )

C:\Users\neelo\OneDrive\Documents\heist-marl>for %A in (10.0.14393.0) do set last=%A

C:\Users\neelo\OneDrive\Documents\heist-marl>set last=10.0.14393.0

C:\Users\neelo\OneDrive\Documents\heist-marl>for %A in (10.0.15063.0) do set last=%A

C:\Users\neelo\OneDrive\Documents\heist-marl>set last=10.0.15063.0

C:\Users\neelo\OneDrive\Documents\heist-marl>for %A in (10.0.16299.0) do set last=%A

C:\Users\neelo\OneDrive\Documents\heist-marl>set last=10.0.16299.0

C:\Users\neelo\OneDrive\Documents\heist-marl>for %A in (10.0.17134.0) do set last=%A

C:\Users\neelo\OneDrive\Documents\heist-marl>set last=10.0.17134.0

C:\Users\neelo\OneDrive\Documents\heist-marl>for %A in (10.0.17763.0) do set last=%A

C:\Users\neelo\OneDrive\Documents\heist-marl>set last=10.0.17763.0

C:\Users\neelo\OneDrive\Documents\heist-marl>endlocal   & set "PATH=C:\Users\neelo\Anaconda3\envs\procgen;C:\Users\neelo\Anaconda3\envs\procgen\Library\mingw-w64\bin;C:\Users\neelo\Anaconda3\envs\procgen\Library\usr\bin;C:\Users\neelo\Anaconda3\envs\procgen\Library\bin;C:\Users\neelo\Anaconda3\envs\procgen\Scripts;C:\Users\neelo\Anaconda3\envs\procgen\bin;C:\Users\neelo\Anaconda3\condabin;C:\Program Files (x86)\Common Files\Oracle\Java\javapath;C:\Program Files (x86)\Intel\iCLS Client;C:\Program Files (x86)\NVIDIA Corporation\PhysX\Common;C:\Program Files\Intel\iCLS Client;C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\System32\Wbem;C:\WINDOWS\System32\WindowsPowerShell\v1.0;C:\Program Files\Microsoft SQL Server\Client SDK\ODBC\110\Tools\Binn;C:\Program Files (x86)\Microsoft SQL Server\120\Tools\Binn;C:\Program Files\Microsoft SQL Server\120\Tools\Binn;C:\Program Files\Microsoft SQL Server\120\DTS\Binn;C:\Program Files (x86)\Windows Kits\8.1\Windows Performance Toolkit;C:\Program Files\Git\cmd;C:\Program Files (x86)\Intel\Intel(R) Management Engine Components\DAL;C:\Program Files\Intel\Intel(R) Management Engine Components\DAL;C:\Program Files (x86)\Intel\Intel(R) Management Engine Components\IPT;C:\Program Files\Intel\Intel(R) Management Engine Components\IPT;C:\WINDOWS\System32\OpenSSH;C:\Program Files (x86)\Symantec\VIP Access Client;C:\Program Files (x86)\Wolfram Research\WolframScript;C:\Program Files\nodejs;C:\ProgramData\chocolatey\bin;C:\Program Files\Java\jdk1.8.0_201\bin;C:\Android\android-sdk\tools;C:\Android\android-sdk\platform-tools;C:\Android\android-sdk\tools\bin;C:\Program Files\Intel\WiFi\bin;C:\Program Files\Common Files\Intel\WirelessCommon;C:\Program Files\PuTTY;C:\Ruby26-x64\bin;C:\Users\neelo\AppData\Local\Programs\Python\Python36\Scripts;C:\Users\neelo\AppData\Local\Programs\Python\Python36;C:\Users\neelo\AppData\Local\Programs\Python\Launcher;C:\Users\neelo\AppData\Local\Microsoft\WindowsApps;C:\Users\neelo\AppData\Local\GitHubDesktop\bin;C:\Users\neelo\AppData\Local\Microsoft\WindowsApps;C:\Users\neelo\AppData\Local\atom\bin;C:\intelFPGA_lite\18.0\modelsim_ase\win32aloem;C:\Users\neelo\AppData\Roaming\npm;C:\intelFPGA_lite\18.0\quartus\sopc_builder\bin;.;C:\Program Files\JetBrains\PyCharm Community Edition 2018.3.7\bin;.;C:\Users\neelo\AppData\Local\Programs\Microsoft VS Code\bin;C:\Program Files (x86)\Windows Kits\10\bin\10.0.17763.0\x86;C:\Program Files (x86)\Windows Kits\10\bin\10.0.17763.0\x86"

C:\Users\neelo\OneDrive\Documents\heist-marl>IF NOT "" == "" (
set "INCLUDE=;"
 set "LIB=;"
 set "CMAKE_PREFIX_PATH=;"
)

C:\Users\neelo\OneDrive\Documents\heist-marl>SET "CMAKE_GENERATOR=Visual Studio 14 2015 Win64"

C:\Users\neelo\OneDrive\Documents\heist-marl>CALL "C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\..\..\VC\vcvarsall.bat" amd64
The system cannot find the path specified.

C:\Users\neelo\OneDrive\Documents\heist-marl>SET DISTUTILS_USE_SDK=1

C:\Users\neelo\OneDrive\Documents\heist-marl>SET MSSdk=1

C:\Users\neelo\OneDrive\Documents\heist-marl>SET "VS_VERSION=15.0"

C:\Users\neelo\OneDrive\Documents\heist-marl>SET "VS_MAJOR=15"

C:\Users\neelo\OneDrive\Documents\heist-marl>SET "VS_YEAR=2017"

C:\Users\neelo\OneDrive\Documents\heist-marl>set "MSYS2_ARG_CONV_EXCL=/AI;/AL;/OUT;/out"

C:\Users\neelo\OneDrive\Documents\heist-marl>set "MSYS2_ENV_CONV_EXCL=CL"

C:\Users\neelo\OneDrive\Documents\heist-marl>set "PY_VCRUNTIME_REDIST=\bin\vcruntime140.dll"

C:\Users\neelo\OneDrive\Documents\heist-marl>set "CXX=cl.exe"

C:\Users\neelo\OneDrive\Documents\heist-marl>set "CC=cl.exe"

C:\Users\neelo\OneDrive\Documents\heist-marl>CALL C:\Users\neelo\Anaconda3\envs\procgen\etc\conda\activate.d\vs2017_get_vsinstall_dir.bat
Windows SDK version found as: "10.0.17763.0"
The system cannot find the path specified.

So after that, I run pip install -e ., and it says the package is installed successfully.

Finally, I try to build the given example with python -c "from procgen import ProcgenGym3Env; ProcgenGym3Env(num=1, env_name='coinrun')", and I get the following error:

building procgen...Traceback (most recent call last):
  File "<string>", line 1, in <module>
  File "C:\Users\neelo\OneDrive\Documents\heist-marl\procgen\env.py", line 246, in __init__
    super().__init__(num, env_name, options, **kwargs)
  File "C:\Users\neelo\OneDrive\Documents\heist-marl\procgen\env.py", line 96, in __init__
    lib_dir = build(debug=debug)
  File "C:\Users\neelo\OneDrive\Documents\heist-marl\procgen\build.py", line 120, in build
    _attempt_configure(build_type, package)
  File "C:\Users\neelo\OneDrive\Documents\heist-marl\procgen\build.py", line 61, in _attempt_configure
    sp.run(["conda", "info", "--json"], stdout=sp.PIPE).stdout
  File "C:\Users\neelo\Anaconda3\envs\procgen\lib\subprocess.py", line 472, in run
    with Popen(*popenargs, **kwargs) as process:
  File "C:\Users\neelo\Anaconda3\envs\procgen\lib\subprocess.py", line 775, in __init__
    restore_signals, start_new_session)
  File "C:\Users\neelo\Anaconda3\envs\procgen\lib\subprocess.py", line 1178, in _execute_child
    startupinfo)
FileNotFoundError: [WinError 2] The system cannot find the file specified

In case it helps, this is the output of cmake --version:

cmake version 3.14.0

CMake suite maintained and supported by Kitware (kitware.com/cmake).

And this is the output of where cmake: C:\Users\neelo\Anaconda3\envs\procgen\Library\bin\cmake.exe

Help would be very much appreciated, and please let me know if I can provide any further details.

Thanks!

christopherhesse commented 4 years ago

You should probably have filed a new issue for this. The error appears to be when running conda, not cmake. Is conda in your path? I'm a little surprised that it's failing there because you're using a conda environment, but windows paths/environment variables are finicky.

TheNeeloy commented 4 years ago

Hey, thanks for the reply.

I came to that conclusion as well, and when I added conda to the path, it still was producing the same error, so I ended up hardcoding the conda_prefix variable in build.py, and it now outputs this error instead:

building procgen...done
Traceback (most recent call last):
  File "<string>", line 1, in <module>
  File "C:\Users\neelo\OneDrive\Documents\heist-marl\procgen\env.py", line 246, in __init__
    super().__init__(num, env_name, options, **kwargs)
  File "C:\Users\neelo\OneDrive\Documents\heist-marl\procgen\env.py", line 134, in __init__
    "void set_state(libenv_env *, int, char *, int);",
  File "C:\Users\neelo\Anaconda3\envs\procgen\lib\site-packages\gym3\libenv.py", line 111, in __init__
    self._c_lib = self._ffi.dlopen(name=self._lib_path, flags=dlopen_flags)
  File "C:\Users\neelo\Anaconda3\envs\procgen\lib\site-packages\cffi\api.py", line 150, in dlopen
    lib, function_cache = _make_ffi_library(self, name, flags)
  File "C:\Users\neelo\Anaconda3\envs\procgen\lib\site-packages\cffi\api.py", line 832, in _make_ffi_library
    backendlib = _load_backend_lib(backend, libname, flags)
  File "C:\Users\neelo\Anaconda3\envs\procgen\lib\site-packages\cffi\api.py", line 828, in _load_backend_lib
    return backend.load_library(path, flags)
OSError: cannot load library 'C:\Users\neelo\OneDrive\Documents\heist-marl\procgen\.build\relwithdebinfo\relwithdebinfo\env.dll': error 0x7e

It seems like it tries to load a dll but it fails? I double checked that the env.dll file does in fact exist where the traceback is trying to load it from.

Would you happen to know any way to go from here? Since I received this error, I actually installed procgen on a ubuntu VM, and building has been working fine. But it would be nice to work from the standard windows environment if possible.

christopherhesse commented 4 years ago

This is tested in the travis windows environment, and I think I tested it on my windows computer earlier. This issue: https://bitbucket.org/cffi/cffi/issues/417/oserror-cannot-load-library-c-local-libs seems to indicate it's another issue with path environment variables.

My random guess is that this is linking against conda Qt, but you don't have the path to conda's Qt DLLs in your PATH environment variable, so seems similar to the previous problem of not having conda paths setup correctly.

christopher-hesse commented 4 years ago

I checked this on my windows computer and following the instructions in the readme worked fine. Most likely your conda installation is broken, try following the instructions at https://conda.io/projects/conda/en/latest/user-guide/install/windows.html or possibly the chocolatey installer.

christopher-hesse commented 4 years ago

Actually when you do conda activate, it says "The system cannot find the path specified." at the end, so that's likely related to the issue. I'm also using VS 14.0, so maybe that matters to conda.