Search Unity

Question AttributeError: 'PathDistribution' object has no attribute 'entry_points'

Discussion in 'ML-Agents' started by Yuulis04, May 11, 2021.

  1. Yuulis04

    Yuulis04

    Joined:
    Apr 4, 2021
    Posts:
    28
    For training the environment on Release 17, I followed these guide:
    https://github.com/Unity-Technologies/ml-agents/blob/main/docs/Installation.md
    https://github.com/Unity-Technologies/ml-agents/blob/main/docs/Getting-Started.md

    But, when I run
    mlagents-learn
    command, this error happened:

    Traceback (most recent call last):
    File "C:\Users\Yuulis\anaconda3\envs\mlagents2\Scripts\mlagents-learn-script.py", line 33, in <module>
    sys.exit(load_entry_point('mlagents', 'console_scripts', 'mlagents-learn')())
    File "C:\Users\Yuulis\anaconda3\envs\mlagents2\Scripts\mlagents-learn-script.py", line 22, in importlib_load_entry_point
    for entry_point in distribution(dist_name).entry_points
    AttributeError: 'PathDistribution' object has no attribute 'entry_points'

    In fact, the same error happened when I tried on Release 12. At that time, I downloaded https://github.com/Unity-Technologies/ml-agents/tree/release_12_branch instead of https://github.com/Unity-Technologies/ml-agents/tree/release_12_docs and I solved the problem.

    But this time, I downloaded https://github.com/Unity-Technologies/ml-agents/tree/release_17_branch , so maybe it doesn't cause problem. Where is the problem?

    <My Situation>
    ・I created a virtual environment "mlagents2" for python 3.6.7 with Anaconda3.
    ・I downloaded Release 17's branch.
    ・I ran the following commands in sequence on Anaconda3:

    (mlagents2) C:\Users\Yuulis>pip install torch==1.7.1 -f https://download.pytorch.org/whl/torch_stable.html
    (mlagents2) C:\Users\Yuulis>cd C:\Users\Yuulis\ML-Agents\ml-agents-release_17_branch
    (mlagents2) C:\Users\Yuulis>cd ml-agents-envs
    (mlagents2) C:\Users\Yuulis>pip install -e .
    (mlagents2) C:\Users\Yuulis>cd ..
    (mlagents2) C:\Users\Yuulis>cd ml-agents
    (mlagents2) C:\Users\Yuulis>pip install -e .

    And I checked these packages installed:
    mlagents==0.26.0
    mlagents-envs==0.26.0
    torch==1.7.1+cu110
     
  2. christophergoy

    christophergoy

    Unity Technologies

    Joined:
    Sep 16, 2015
    Posts:
    735
    hi @Yuulis04,
    Have is mlagents-learn installed in your global environment and leaking into your virtual env? Could you make sure it is completely uninstalled and try again?
     
  3. Yuulis04

    Yuulis04

    Joined:
    Apr 4, 2021
    Posts:
    28
    How can I check "leaking into virtual env"?
     
  4. christophergoy

    christophergoy

    Unity Technologies

    Joined:
    Sep 16, 2015
    Posts:
    735
    On windows you can use:
    where mlagents-learn

    To see where the executable lives. If the path returned from that command isn’t in your virtual environment, it may mean mlagents-learn is installed in your global environment.
     
  5. Yuulis04

    Yuulis04

    Joined:
    Apr 4, 2021
    Posts:
    28
    @christophergoy
    The path returned like this:
    C:\Users\yuulis\anaconda3\envs\mlagents2\Scripts\mlagents-learn.exe

    Is this place correct?

    In the case of Release 12, which works fine, like this:
    C:\Users\Yuulis\anaconda3\envs\ml-agents\Scripts\mlagents-learn.exe
     
    Last edited: May 15, 2021