首页 > 解决方案 > How to fix 'invalid syntax error' in tensorwatch?

问题描述

After I installed the tensorwatch package, I imported it but here was an error. Some details are shown below, could anyone help me? Thanks a lot.

import tensorwatch

Traceback (most recent call last):

  File "C:\Users\33574\Anaconda3\envs\tensorflow2\lib\site-packages\IPython\core\interactiveshell.py", line 2862, in run_code
    exec(code_obj, self.user_global_ns, self.user_ns)

  File "<ipython-input-1-d0d9e150d101>", line 1, in <module>
    import tensorwatch

  File "C:\Users\33574\Anaconda3\envs\tensorflow2\lib\site-packages\tensorwatch\__init__.py", line 6, in <module>
    from .watcher_client import WatcherClient

  File "C:\Users\33574\Anaconda3\envs\tensorflow2\lib\site-packages\tensorwatch\watcher_client.py", line 5, in <module>
    from .zmq_wrapper import ZmqWrapper

  File "C:\Users\33574\Anaconda3\envs\tensorflow2\lib\site-packages\tensorwatch\zmq_wrapper.py", line 16
    _thread:Thread = None
           ^
SyntaxError: invalid syntax

标签: pythontensorflow

解决方案


确保您的 python 版本是 3.5。它可能在 Ubuntu 16.06 LTS 中工作,但我在 Windows 上遇到同样的问题


推荐阅读