Search Unity

  1. Megacity Metro Demo now available. Download now.
    Dismiss Notice
  2. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

mlagents-learn ContextualVersionConflict error related to setuptools

Discussion in 'ML-Agents' started by Forrest-Trepte, Jul 3, 2020.

  1. Forrest-Trepte

    Forrest-Trepte

    Joined:
    Jan 22, 2013
    Posts:
    8
    I needed to upgrade setuptools before the mlagents-learn script worked for me. It seems like that should have automatically been handled as part of installing ml-agents or listed as a step as part of the setup instructions. I'm not knowledgeable enough in Python packages configuration to know how this should have worked, but please let me know if you think I should open an issue about it on the ml-agents github.

    Details...

    I recently followed the installation instructions for release 3 and received the following error when I tried to execute mlagents-learn:
    (mlagents_release_3) (base) C:\p\ml-agents-test\MLAgentsTest.Unity\Assets\MLAgentsTest\Tests\SimpleLearningEnvironment>mlagents-learn rollerball_config.yaml --run-id=RollerBall
    Traceback (most recent call last):
    File "c:\s\python-envs\mlagents_release_3\lib\site-packages\pkg_resources\__init__.py", line 574, in _build_master
    ws.require(__requires__)
    File "c:\s\python-envs\mlagents_release_3\lib\site-packages\pkg_resources\__init__.py", line 892, in require
    needed = self.resolve(parse_requirements(requirements))
    File "c:\s\python-envs\mlagents_release_3\lib\site-packages\pkg_resources\__init__.py", line 783, in resolve
    raise VersionConflict(dist, req).with_context(dependent_req)
    pkg_resources.ContextualVersionConflict: (setuptools 39.0.1 (c:\s\python-envs\mlagents_release_3\lib\site-packages), Requirement.parse('setuptools>=41.0.0'), {'tensorboard'})​

    I was able to fix it by running pip install --upgrade setuptools, so I don't need help. But I thought I'd post here in case others have the same problem.

    In case it's relevant, instead of installing from PyPi I used the Advanced: Local Installation for Development option for installing ml-agents-envs and ml-agents directly from a clone of release_3.