Search code examples
unity-game-enginetensorboardpython-wheel

pkg_resources.DistributionNotFound: The 'wheel>=0.26; python_version >= "3"' distribution was not found and is required by tensorboard


When I was installing the ml-agents from unity,i encountered a problem. i was not able to fix it at this moment. I am running an env through anaconda. i entered the command: mlagents-learn to verify the installation

(unity_envIAJ) C:\Users\Rui\Documents\GitHub\ml-agents-release_10>mlagents-learn
Traceback (most recent call last):
  File "D:\Conda\envs\unity_envIAJ\lib\site-packages\pkg_resources\__init__.py", line 567, in _build_master
    ws.require(__requires__)
  File "D:\Conda\envs\unity_envIAJ\lib\site-packages\pkg_resources\__init__.py", line 884, in require
    needed = self.resolve(parse_requirements(requirements))
  File "D:\Conda\envs\unity_envIAJ\lib\site-packages\pkg_resources\__init__.py", line 775, in resolve
    raise VersionConflict(dist, req).with_context(dependent_req)
pkg_resources.ContextualVersionConflict: (numpy 1.19.2 (d:\conda\envs\unity_enviaj\lib\site-packages), Requirement.parse('numpy<1.19.0,>=1.14.1'), {'mlagents-envs'})

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "D:\Conda\envs\unity_envIAJ\Scripts\mlagents-learn-script.py", line 33, in <module>
    sys.exit(load_entry_point('mlagents', 'console_scripts', 'mlagents-learn')())
  File "D:\Conda\envs\unity_envIAJ\Scripts\mlagents-learn-script.py", line 25, in importlib_load_entry_point
    return next(matches).load()
  File "D:\Conda\envs\unity_envIAJ\lib\importlib\metadata.py", line 75, in load
    module = import_module(match.group('module'))
  File "D:\Conda\envs\unity_envIAJ\lib\importlib\__init__.py", line 127, in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
  File "<frozen importlib._bootstrap>", line 1014, in _gcd_import
  File "<frozen importlib._bootstrap>", line 991, in _find_and_load
  File "<frozen importlib._bootstrap>", line 975, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 671, in _load_unlocked
  File "<frozen importlib._bootstrap_external>", line 783, in exec_module
  File "<frozen importlib._bootstrap>", line 219, in _call_with_frames_removed
  File "c:\users\rui\documents\github\ml-agents-release_10\ml-agents\mlagents\trainers\learn.py", line 2, in <module>
    from mlagents import torch_utils
  File "c:\users\rui\documents\github\ml-agents-release_10\ml-agents\mlagents\torch_utils\__init__.py", line 1, in <module>
    from mlagents.torch_utils.torch import torch as torch  # noqa
  File "c:\users\rui\documents\github\ml-agents-release_10\ml-agents\mlagents\torch_utils\torch.py", line 4, in <module>
    import pkg_resources
  File "D:\Conda\envs\unity_envIAJ\lib\site-packages\pkg_resources\__init__.py", line 3239, in <module>
    def _initialize_master_working_set():
  File "D:\Conda\envs\unity_envIAJ\lib\site-packages\pkg_resources\__init__.py", line 3222, in _call_aside
    f(*args, **kwargs)
  File "D:\Conda\envs\unity_envIAJ\lib\site-packages\pkg_resources\__init__.py", line 3251, in _initialize_master_working_set
    working_set = WorkingSet._build_master()
  File "D:\Conda\envs\unity_envIAJ\lib\site-packages\pkg_resources\__init__.py", line 569, in _build_master
    return cls._build_from_requirements(__requires__)
  File "D:\Conda\envs\unity_envIAJ\lib\site-packages\pkg_resources\__init__.py", line 582, in _build_from_requirements
    dists = ws.resolve(reqs, Environment())
  File "D:\Conda\envs\unity_envIAJ\lib\site-packages\pkg_resources\__init__.py", line 770, in resolve
    raise DistributionNotFound(req, requirers)
pkg_resources.DistributionNotFound: The 'wheel>=0.26; python_version >= "3"' distribution was not found and is required by tensorboard

python version: 3.8.0 tensorboard: 2.4.0 wheel: 0.36.2


Solution

  • I had to change the numpy for the correct version and proceeded to uninstall any tensorboard and tensorflow related packages and only install through conda tensorboard.