Unity-Technologies / ml-agents

The Unity Machine Learning Agents Toolkit (ML-Agents) is an open-source project that enables games and simulations to serve as environments for training intelligent agents using deep reinforcement learning and imitation learning.
https://unity.com/products/machine-learning-agents
Other
17.19k stars 4.16k forks source link

getsitepackages #2890

Closed EgonGoodman closed 5 years ago

EgonGoodman commented 5 years ago

hi guys. I'm a beginner in RL/Python/Unity and have no Idea what I did wrong.

I tried to follow this description:

https://github.com/Unity-Technologies/ml-agents/blob/master/docs/Installation.md

but before I started I created a venv in python.

after I used pip3 install mlagents nothing worked anymore. When I want to use mlagents-learn --help. I always get this message:

Failed to import the site module
Traceback (most recent call last):
  File "c:\users\XXX\desktop\unity\try\venv\lib\site.py", line 769, in <module>
    main()
  File "c:\users\XXX\desktop\unity\try\venv\lib\site.py", line 746, in main
    paths_in_sys = addsitepackages(paths_in_sys)
  File "c:\users\XXX\desktop\unity\try\venv\lib\site.py", line 279, in addsitepackages
    addsitedir(sitedir, known_paths)
  File "c:\users\XXX\desktop\unity\try\venv\lib\site.py", line 202, in addsitedir
    addpackage(sitedir, name, known_paths)
  File "c:\users\XXX\desktop\unity\try\venv\lib\site.py", line 170, in addpackage
    exec(line)
  File "<string>", line 1, in <module>
  File "c:\users\XXX\desktop\unity\try\venv\lib\site-packages\win32\lib\pywin32_bootstrap.py", line 14, in <module>
    for maybe in site.getsitepackages():
AttributeError: module 'site' has no attribute 'getsitepackages' 

Before I used pip3 install mlagents everything works normal. When i leave the venv and ask for the pip list I get this:

Package    Version
---------- -------
pip        19.3.1
setuptools 40.6.2
virtualenv 16.7.7
wheel      0.33.6

I hope you can help me.

mlegas commented 5 years ago

This is an issue related to the newest build of PyWin32, which has trouble running with virtual environments: PyWin32 (226) and virtual environments

During the installation of mlagents by PIP, one of the requirements is the xlwings package, which has a requirement of the pywin32 version >= 224, therefore downloading and installing the newest build of pywin32.

Try using: pip3 install pywin32==225

before running: pip3 install mlagents

EgonGoodman commented 5 years ago

Thank you for your help Tylawoj! It worked out! I tried over 8 hours and now it works.

github-actions[bot] commented 3 years ago

This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.