Search Unity

  1. Unity 6 Preview is now available. To find out what's new, have a look at our Unity 6 Preview blog post.
    Dismiss Notice
  2. Unity is excited to announce that we will be collaborating with TheXPlace for a summer game jam from June 13 - June 19. Learn more.
    Dismiss Notice
  3. Dismiss Notice

Question ml-agents installation error on mac

Discussion in 'ML-Agents' started by JapaneseOnion, Mar 9, 2024.

  1. JapaneseOnion


    Dec 21, 2023
    I keep on getting this error when trying run
    "python -m pip install ./ml-agents-envs"
    in my terminal. I have activated a virtual environment and ran the command above. My python version in 3.11.5, but I could not find a way to install the recommended 3.10.12.
    Screenshot 2024-03-09 at 3.17.51 PM.png
    santhmithran likes this.
  2. santhmithran


    Aug 11, 2018
    I am also facing the same problems with ML agents installing. Have you find any solution

    (cursoml1) santhakumar@santhakumars-MacBook-Pro ml-agents-release_21 % python -m pip install --upgrade pip

    Requirement already satisfied: pip in /Users/santhakumar/Downloads/PythonAnaconda/PythonSubfolder/anaconda3/envs/cursoml1/lib/python3.10/site-packages (24.0)

    (cursoml1) santhakumar@santhakumars-MacBook-Pro ml-agents-release_21 % pip3 install grpcio

    Collecting grpcio

    Using cached grpcio-1.62.1-cp310-cp310-macosx_12_0_universal2.whl.metadata (4.0 kB)

    Downloading grpcio-1.62.1-cp310-cp310-macosx_12_0_universal2.whl (10.0 MB)

    ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 10.0/10.0 MB 3.5 MB/s eta 0:00:00

    Installing collected packages: grpcio

    Successfully installed grpcio-1.62.1

    (cursoml1) santhakumar@santhakumars-MacBook-Pro ml-agents-release_21 % python -m pip install ./ml-agents

    Processing ./ml-agents

    Preparing metadata ( ... done

    Collecting grpcio<=1.48.2,>=1.11.0 (from mlagents==1.0.0)

    Using cached grpcio-1.48.2.tar.gz (22.0 MB)

    Preparing metadata ( ... error

    error: subprocess-exited-with-error

    × python egg_info did not run successfully.

    │ exit code: 1

    ╰─> [16 lines of output]

    /private/tmp/pip-install-74y1cm3q/grpcio_78fdc4213526462e82c8a3633a6a81de/ DeprecationWarning: pkg_resources is deprecated as an API. See

    import pkg_resources

    Traceback (most recent call last):

    File "<string>", line 2, in <module>

    File "<pip-setuptools-caller>", line 34, in <module>

    File "/private/tmp/pip-install-74y1cm3q/grpcio_78fdc4213526462e82c8a3633a6a81de/", line 263, in <module>

    if check_linker_need_libatomic():

    File "/private/tmp/pip-install-74y1cm3q/grpcio_78fdc4213526462e82c8a3633a6a81de/", line 219, in check_linker_need_libatomic

    cpp_test = subprocess.Popen(

    File "/Users/santhakumar/Downloads/PythonAnaconda/PythonSubfolder/anaconda3/envs/cursoml1/lib/python3.10/", line 971, in __init__

    self._execute_child(args, executable, preexec_fn, close_fds,

    File "/Users/santhakumar/Downloads/PythonAnaconda/PythonSubfolder/anaconda3/envs/cursoml1/lib/python3.10/", line 1738, in _execute_child

    and os.path.dirname(executable)

    File "/Users/santhakumar/Downloads/PythonAnaconda/PythonSubfolder/anaconda3/envs/cursoml1/lib/python3.10/", line 152, in dirname

    p = os.fspath(p)

    TypeError: expected str, bytes or os.PathLike object, not list

    [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.
  3. therealjapaneseonion


    Apr 10, 2024
    Ok I found the issue. Didn't have time to go through it properly but it seems like you need to have the version of around 3.9 (I did 3.9.19) installed. In the documents it says 3.10.12 or later but since 3.9.19 works for installation. I'll see if theres any more errors later on that I find.
  4. therealjapaneseonion


    Apr 10, 2024
    Also got a random protobuf version error after so just paste
    "pip install --upgrade "protobuf<=3.20.1"
    into your terminal