简体   繁体   中英

can't launch tensorboard from mac terminal

problem: I can't run "tensorboard --logdir=summaries" in my terminal because I get this error

  • system: macbook pro running Catalina
  • environment: running pyenv with python3 as global
  • package: I have tensorflow 2.2.0 installed via pip
  • I have setuptools 49.1.0

Traceback (most recent call last): File "/usr/local/bin/tensorboard", line 10, in sys.exit(run_main()) File "/Library/Python/3.7/site-packages/tensorboard/main.py", line 65, in run_main default.get_plugins() + default.get_dynamic_plugins(), File "/Library/Python/3.7/site-packages/tensorboard/default.py", line 125, in get_dynamic_plugins "tensorboard_plugins" File "/Library/Python/3.7/site-packages/tensorboard/default.py", line 124, in for entry_point in pkg_resources.iter_entry_points( File "/Library/Developer/CommandLineTools/Library/Frameworks/Python3.framework/Versions/3.7/lib/python3.7/site-packages/pkg_resources/ init .py", line 2410, in load self.require(*args, **kwargs) File "/Library/Developer/CommandLineTools/Library/Frameworks/Python3.framework/Versions/3.7/lib/python3.7/site-packages/pkg_resources/ init .py", line 2433, in require items = working_set.resolve(reqs, env, installer, extras=self.extras) File "/Library/Developer/CommandLineTools/Library/Frameworks/Python3.framewo rk/Versions/3.7/lib/python3.7/site-packages/pkg_resources/ init .py", line 791, in resolve raise VersionConflict(dist, req).with_context(dependent_req) pkg_resources.VersionConflict: (setuptools 40.8.0 (/Library/Developer/CommandLineTools/Library/Frameworks/Python3.framework/Versions/3.7/lib/python3.7/site-packages), Requirement.parse('setuptools>=41.0.0'))

the setuptools version you have is 40.8.0. tensorboard needs setuptools>=41.0.0.

So there are two solutions:

  1. update setuptools to >=41.0.0
  2. create a new environment with setuptools>=41.0.0.

MacOs may not allow you to update setuptools, due to system integrity protection Adding --user python to the command allowed this to work.

In other words

pip install --upgrade setuptools --user python

As it turns out I was not using Pyenv correctly. Once I used "pyenv global system" then I was able to update the pip packages correctly and the right setuptools was installed and TensorBoard ran as expected

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM