Search Unity

Question Issue installing on Mac OS

Discussion in 'ML-Agents' started by andreialbu03, Nov 28, 2021.

  1. andreialbu03

    andreialbu03

    Joined:
    Nov 28, 2021
    Posts:
    2
    Hello,
    I am unable to install ml-agents on my Mac to a pipenv virtual environment.

    Environment
    - Unity 2020.3.23f1
    - M1 apple silicon
    - Mac OS X (Monterey 12.0.1)

    I am following this guide for installation https://github.com/Unity-Technologies/ml-agents/blob/main/docs/Installation.md

    I have installed Python 3.8.9 for my virtual environment
    The command
    python --version
    returns
    Python 3.8.9


    pipenv version is 2021.5.29 and I use
    pipenv shell
    to activate the virtual environment.

    Using the command
    pipenv install mlagents

    to install mlagents to my virtual environment.

    When running
    pipenv install mlagents
    I receive this error

    (mlAgentsTutorial) andreialbu@Andreis-MBP mlAgentsTutorial % pipenv install mlagents
    Installing mlagents...
    Error: An error occurred while installing mlagents!
    Error text: Collecting mlagents
    Using cached mlagents-0.27.0-py3-none-any.whl (160 kB)
    Collecting tensorboard>=1.15
    Using cached tensorboard-2.7.0-py3-none-any.whl (5.8 MB)
    Collecting grpcio>=1.11.0
    Using cached grpcio-1.42.0.tar.gz (21.3 MB)
    Collecting attrs>=19.3.0
    Using cached attrs-21.2.0-py2.py3-none-any.whl (53 kB)
    Collecting cattrs<1.7,>=1.1.0
    Downloading cattrs-1.5.0-py3-none-any.whl (19 kB)
    Collecting mlagents
    Using cached mlagents-0.26.0-py3-none-any.whl (160 kB)
    Using cached mlagents-0.25.1-py3-none-any.whl (157 kB)
    Collecting mlagents-envs==0.25.1
    Using cached mlagents_envs-0.25.1-py3-none-any.whl (75 kB)
    Collecting mlagents
    Using cached mlagents-0.25.0-py3-none-any.whl (156 kB)
    Using cached mlagents-0.24.1-py3-none-any.whl (137 kB)
    Collecting mlagents-envs==0.24.1
    Using cached mlagents_envs-0.24.1-py3-none-any.whl (75 kB)
    Collecting numpy<2.0,>=1.13.3
    Using cached numpy-1.21.4-cp38-cp38-macosx_11_0_arm64.whl (12.3 MB)
    Collecting cattrs>=1.1.0
    Using cached cattrs-1.8.0-py3-none-any.whl (24 kB)
    Collecting protobuf>=3.6
    Using cached protobuf-3.19.1-py2.py3-none-any.whl (162 kB)
    Collecting pyyaml>=3.1.0
    Using cached PyYAML-6.0.tar.gz (124 kB)
    Installing build dependencies: started
    Installing build dependencies: finished with status 'done'
    Getting requirements to build wheel: started
    Getting requirements to build wheel: finished with status 'done'
    Preparing wheel metadata: started
    Preparing wheel metadata: finished with status 'done'
    Collecting h5py>=2.9.0
    Using cached h5py-3.6.0.tar.gz (384 kB)
    Installing build dependencies: started
    Installing build dependencies: finished with status 'done'
    Getting requirements to build wheel: started
    Getting requirements to build wheel: finished with status 'done'
    Preparing wheel metadata: started
    Preparing wheel metadata: finished with status 'done'
    Collecting mlagents
    Using cached mlagents-0.24.0-py3-none-any.whl (137 kB)
    Collecting mlagents-envs==0.24.0
    Using cached mlagents_envs-0.24.0-py3-none-any.whl (75 kB)
    Collecting cattrs<1.1.0,>=1.0.0
    Using cached cattrs-1.0.0-py2.py3-none-any.whl (14 kB)
    Collecting mlagents
    Using cached mlagents-0.23.0-py3-none-any.whl (199 kB)
    Using cached mlagents-0.22.0-py3-none-any.whl (192 kB)
    Collecting mlagents-envs==0.22.0
    Using cached mlagents_envs-0.22.0-py3-none-any.whl (70 kB)
    Collecting mlagents
    Using cached mlagents-0.21.1-py3-none-any.whl (191 kB)
    Collecting six>=1.12.0
    Using cached six-1.16.0-py2.py3-none-any.whl (11 kB)
    Collecting mlagents
    Using cached mlagents-0.21.0-py3-none-any.whl (191 kB)
    Collecting mlagents-envs==0.21.0
    Downloading mlagents_envs-0.21.0-py3-none-any.whl (70 kB)
    Collecting mlagents
    Using cached mlagents-0.20.0-py3-none-any.whl (187 kB)
    Collecting mlagents-envs==0.20.0
    Using cached mlagents_envs-0.20.0-py3-none-any.whl (69 kB)
    Collecting mlagents
    Using cached mlagents-0.19.0-py3-none-any.whl (141 kB)
    Using cached mlagents-0.18.1-py3-none-any.whl (140 kB)
    Using cached mlagents-0.18.0-py3-none-any.whl (140 kB)
    Using cached mlagents-0.17.0-py3-none-any.whl (142 kB)
    Using cached mlagents-0.16.1-py3-none-any.whl (137 kB)
    Using cached mlagents-0.16.0-py3-none-any.whl (137 kB)
    Collecting mlagents-envs==0.16.0
    Using cached mlagents_envs-0.16.0-py3-none-any.whl (59 kB)
    Collecting mlagents
    Using cached mlagents-0.15.1-py3-none-any.whl (128 kB)
    Using cached mlagents-0.15.0-py3-none-any.whl (128 kB)
    Using cached mlagents-0.14.1-py3-none-any.whl (122 kB)
    Using cached mlagents-0.14.0-py3-none-any.whl (122 kB)
    Collecting mlagents-envs==0.14.0
    Using cached mlagents_envs-0.14.0-py3-none-any.whl (51 kB)
    Collecting mlagents
    Using cached mlagents-0.13.1-py3-none-any.whl (117 kB)
    Collecting mlagents-envs==0.13.1
    Downloading mlagents_envs-0.13.1-py3-none-any.whl (51 kB)
    Collecting mlagents
    Using cached mlagents-0.13.0-py3-none-any.whl (117 kB)
    Collecting mlagents-envs==0.13.0
    Downloading mlagents_envs-0.13.0-py3-none-any.whl (51 kB)
    Collecting mlagents
    Using cached mlagents-0.12.1-py3-none-any.whl (106 kB)
    Collecting mlagents-envs==0.12.1
    Downloading mlagents_envs-0.12.1-py3-none-any.whl (54 kB)
    Collecting mlagents
    Using cached mlagents-0.12.0-py3-none-any.whl (106 kB)
    Using cached mlagents-0.11.0-py3-none-any.whl (104 kB)
    Collecting mlagents-envs==0.11.0
    Downloading mlagents_envs-0.11.0-py3-none-any.whl (56 kB)
    Collecting jupyter
    Downloading jupyter-1.0.0-py2.py3-none-any.whl (2.7 kB)
    Collecting matplotlib
    Using cached matplotlib-3.5.0-cp38-cp38-macosx_11_0_arm64.whl (7.1 MB)
    Collecting mlagents
    Using cached mlagents-0.10.1-py3-none-any.whl (106 kB)
    Collecting mlagents-envs==0.10.1
    Using cached mlagents_envs-0.10.1-py3-none-any.whl (56 kB)
    Collecting mlagents
    Using cached mlagents-0.10.0-py3-none-any.whl (209 kB)
    Collecting mlagents-envs==0.10.0
    Using cached mlagents_envs-0.10.0-py3-none-any.whl (56 kB)
    Collecting mlagents
    Using cached mlagents-0.4.0-py3-none-any.whl (71 kB)
    Collecting docopt
    Downloading docopt-0.6.2.tar.gz (25 kB)
    Collecting protobuf==3.5.2
    Using cached protobuf-3.5.2-py2.py3-none-any.whl (388 kB)
    Collecting grpcio==1.11.0
    Downloading grpcio-1.11.0.tar.gz (14.2 MB)

    The conflict is caused by:
    mlagents 0.27.0 depends on torch<1.9.0 and >=1.6.0; platform_system != "Windows" and python_version < "3.9"
    mlagents 0.26.0 depends on torch<1.9.0 and >=1.6.0; platform_system != "Windows" and python_version < "3.9"
    mlagents 0.25.1 depends on torch<1.9.0 and >=1.6.0; platform_system != "Windows" and python_version < "3.9"
    mlagents 0.25.0 depends on torch<1.9.0 and >=1.6.0; platform_system != "Windows" and python_version < "3.9"
    mlagents 0.24.1 depends on torch<1.8.0 and >=1.6.0; platform_system != "Windows"
    mlagents 0.24.0 depends on torch<1.8.0 and >=1.6.0; platform_system != "Windows"
    mlagents 0.23.0 depends on torch<1.8.0 and >=1.6.0; platform_system != "Windows"
    mlagents 0.22.0 depends on torch<1.8.0 and >=1.6.0; platform_system != "Windows"
    mlagents 0.21.1 depends on tensorflow<3.0 and >=1.14
    mlagents 0.21.0 depends on tensorflow<3.0 and >=1.14
    mlagents 0.20.0 depends on tensorflow<3.0 and >=1.14
    mlagents 0.19.0 depends on tensorflow<3.0 and >=1.7
    mlagents 0.18.1 depends on tensorflow<3.0 and >=1.7
    mlagents 0.18.0 depends on tensorflow<3.0 and >=1.7
    mlagents 0.17.0 depends on tensorflow<3.0 and >=1.7
    mlagents 0.16.1 depends on tensorflow<3.0 and >=1.7
    mlagents 0.16.0 depends on tensorflow<3.0 and >=1.7
    mlagents 0.15.1 depends on tensorflow<2.1 and >=1.7
    mlagents 0.15.0 depends on tensorflow<2.1 and >=1.7
    mlagents 0.14.1 depends on tensorflow<2.1 and >=1.7
    mlagents 0.14.0 depends on tensorflow<2.1 and >=1.7
    mlagents 0.13.1 depends on tensorflow<2.1 and >=1.7
    mlagents 0.13.0 depends on tensorflow<2.1 and >=1.7
    mlagents 0.12.1 depends on tensorflow<2.1 and >=1.7
    mlagents 0.12.0 depends on tensorflow<2.1 and >=1.7
    mlagents 0.11.0 depends on tensorflow<2.0 and >=1.7
    mlagents 0.10.1 depends on tensorflow<2.0 and >=1.7
    mlagents 0.10.0 depends on tensorflow<2.0 and >=1.7
    mlagents 0.4.0 depends on tensorflow==1.7.1

    To fix this you could try to:
    1. loosen the range of package versions you've specified
    2. remove package versions to allow pip attempt to solve the dependency conflict


    ERROR: Cannot install -r /var/folders/3d/_7r8hqyd6td_gq695rtyvl3w0000gn/T/pipenv-1kvaytdz-requirements/pipenv-bqrbuql7-requirement.txt (line 1) because these package versions have conflicting dependencies.
    ERROR: ResolutionImpossible: for help visit https://pip.pypa.io/en/latest/user_guide/#fixing-conflicting-dependencies

    ✘ Installation Failed


    EDIT
    I also tried installing mlagents with venv using python 3.9.7 using the command
    python -m pip install mlagents==0.27.0
    and I am receiving this error


    (mlAgents) andreialbu@Andreis-MBP Unity % python -m pip install mlagents==0.27.0
    Collecting mlagents==0.27.0
    Downloading mlagents-0.27.0-py3-none-any.whl (160 kB)
    |████████████████████████████████| 160 kB 3.5 MB/s
    Collecting Pillow>=4.2.1
    Downloading Pillow-8.4.0-cp39-cp39-macosx_11_0_arm64.whl (2.8 MB)
    |████████████████████████████████| 2.8 MB 25.3 MB/s
    Collecting cattrs<1.7,>=1.1.0
    Downloading cattrs-1.5.0-py3-none-any.whl (19 kB)
    Collecting pyyaml>=3.1.0
    Using cached PyYAML-6.0-cp39-cp39-macosx_11_0_arm64.whl (173 kB)
    Collecting protobuf>=3.6
    Downloading protobuf-3.19.1-py2.py3-none-any.whl (162 kB)
    |████████████████████████████████| 162 kB 29.9 MB/s
    Collecting numpy<2.0,>=1.13.3
    Downloading numpy-1.21.4-cp39-cp39-macosx_11_0_arm64.whl (12.4 MB)
    |████████████████████████████████| 12.4 MB 18.5 MB/s
    Collecting attrs>=19.3.0
    Downloading attrs-21.2.0-py2.py3-none-any.whl (53 kB)
    |████████████████████████████████| 53 kB 14.3 MB/s
    Collecting tensorboard>=1.15
    Downloading tensorboard-2.7.0-py3-none-any.whl (5.8 MB)
    |████████████████████████████████| 5.8 MB 66.0 MB/s
    ERROR: Could not find a version that satisfies the requirement torch<1.9.0,>=1.8.0; platform_system != "Windows" and python_version >= "3.9" (from mlagents) (from versions: 1.9.0, 1.10.0)
    ERROR: No matching distribution found for torch<1.9.0,>=1.8.0; platform_system != "Windows" and python_version >= "3.9"
     
    Last edited: Nov 29, 2021