skip to Main Content

First, the elephant in the room: I have indeed taken a look at Can't install stable-baselines3[extra] and Problems installing stable-baselines3[extra] and gym[all].

Okay, so on (Windows) Terminal I used pip install stable-baselines3, and it gave me the following output:

Collecting stable-baselines3
  Using cached stable_baselines3-2.4.0-py3-none-any.whl.metadata (4.5 kB)
Requirement already satisfied: gymnasium<1.1.0,>=0.29.1 in c:users▓▓▓▓appdatalocalprogramspythonpython313libsite-packages (from stable-baselines3) (1.0.0)
Collecting numpy<2.0,>=1.20 (from stable-baselines3)
  Using cached numpy-1.26.4.tar.gz (15.8 MB)
  Installing build dependencies ... done
  Getting requirements to build wheel ... done
  Installing backend dependencies ... done
  Preparing metadata (pyproject.toml) ... error
  error: subprocess-exited-with-error

  × Preparing metadata (pyproject.toml) did not run successfully.
  │ exit code: 1
  ╰─> [21 lines of output]
      + C:Users▓▓▓▓AppDataLocalProgramsPythonPython313python.exe C:Users▓▓▓▓AppDataLocalTemppip-install-9bqz2x1pnumpy_f99cc85af0fe45d7838bd88862461079vendored-mesonmesonmeson.py setup C:Users▓▓▓▓AppDataLocalTemppip-install-9bqz2x1pnumpy_f99cc85af0fe45d7838bd88862461079 C:Users▓▓▓▓AppDataLocalTemppip-install-9bqz2x1pnumpy_f99cc85af0fe45d7838bd88862461079.mesonpy-z47mfrn8 -Dbuildtype=release -Db_ndebug=if-release -Db_vscrt=md --native-file=C:Users▓▓▓▓AppDataLocalTemppip-install-9bqz2x1pnumpy_f99cc85af0fe45d7838bd88862461079.mesonpy-z47mfrn8meson-python-native-file.ini
      The Meson build system
      Version: 1.2.99
      Source dir: C:Users▓▓▓▓AppDataLocalTemppip-install-9bqz2x1pnumpy_f99cc85af0fe45d7838bd88862461079
      Build dir: C:Users▓▓▓▓AppDataLocalTemppip-install-9bqz2x1pnumpy_f99cc85af0fe45d7838bd88862461079.mesonpy-z47mfrn8
      Build type: native build
      Project name: NumPy
      Project version: 1.26.4
      WARNING: Failed to activate VS environment: Could not find C:Program Files (x86)Microsoft Visual StudioInstallervswhere.exe

      ..meson.build:1:0: ERROR: Unknown compiler(s): [['icl'], ['cl'], ['cc'], ['gcc'], ['clang'], ['clang-cl'], ['pgcc']]
      The following exception(s) were encountered:
      Running `icl ""` gave "[WinError 2] The system cannot find the file specified"
      Running `cl /?` gave "[WinError 2] The system cannot find the file specified"
      Running `cc --version` gave "[WinError 2] The system cannot find the file specified"
      Running `gcc --version` gave "[WinError 2] The system cannot find the file specified"
      Running `clang --version` gave "[WinError 2] The system cannot find the file specified"
      Running `clang-cl /?` gave "[WinError 2] The system cannot find the file specified"
      Running `pgcc --version` gave "[WinError 2] The system cannot find the file specified"

      A full log can be found at C:Users▓▓▓▓AppDataLocalTemppip-install-9bqz2x1pnumpy_f99cc85af0fe45d7838bd88862461079.mesonpy-z47mfrn8meson-logsmeson-log.txt
      [end of output]

  note: This error originates from a subprocess, and is likely not a problem with pip.
error: metadata-generation-failed

× Encountered error while generating package metadata.
╰─> See above for output.

note: This is an issue with the package mentioned above, not pip.
hint: See above for details.

Note that the error in Can't install stable-baselines3[extra] is with build dependences, while here it is with preparing metadata. Additionally I have tried everything mentioned in the said post — pip install git+https://github.com/DLR-RM/stable-baselines3, pip install stable-baselines3[extra] and pip install git+https://github.com/carlosluis/stable-baselines3@fix_tests give the same errors. Any help would be appreciated. Thanks!

2

Answers


  1. First, Stable-Baselines3 requires python 3.8+ and PyTorch >= 2.3. For Windows users such as you, the docs states:

    We recommend using Anaconda for Windows users for easier installation of Python packages and required libraries. You need an environment with Python version 3.8 or above.

    If you want to install Stable Baselines3 with pip, execute:

    pip install stable-baselines3
    

    It should be noted that information on PyPI shows that this package supports Python 3.8 – 3.11. It is not clear whether or not your Python version (3.13) is currently supported. Perhaps you should try Python 3.11 and see if it helps.

    Login or Signup to reply.
  2. Add Python version. Or whatever Python version you have.

    py -3.10 -m pip install stable-baselines3
    
    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search