tensorwatch icon indicating copy to clipboard operation
tensorwatch copied to clipboard

Import Error

Open shengtao96 opened this issue 6 years ago • 4 comments

I use pip install tensorwatch to install the package.

When I import it, I get the error.

Traceback (most recent call last):

  File "/home/shengtao/venv/lib/python3.5/site-packages/IPython/core/interactiveshell.py", line 3291, in run_code
    exec(code_obj, self.user_global_ns, self.user_ns)

  File "<ipython-input-7-72273cc44010>", line 1, in <module>
    import tensorwatch as tw

  File "/home/shengtao/venv/lib/python3.5/site-packages/tensorwatch/__init__.py", line 6, in <module>
    from .watcher_client import WatcherClient

  File "/home/shengtao/venv/lib/python3.5/site-packages/tensorwatch/watcher_client.py", line 5, in <module>
    from .zmq_wrapper import ZmqWrapper

  File "/home/shengtao/venv/lib/python3.5/site-packages/tensorwatch/zmq_wrapper.py", line 16
    _thread:Thread = None
           ^
SyntaxError: invalid syntax

Then, I download the source code and run python setup.py install. The error is:

byte-compiling build/bdist.linux-x86_64/egg/tensorwatch/file_stream.py to file_stream.cpython-35.pyc
byte-compiling build/bdist.linux-x86_64/egg/tensorwatch/plotly/embeddings_plot.py to embeddings_plot.cpython-35.pyc
byte-compiling build/bdist.linux-x86_64/egg/tensorwatch/plotly/line_plot.py to line_plot.cpython-35.pyc
byte-compiling build/bdist.linux-x86_64/egg/tensorwatch/plotly/base_plotly_plot.py to base_plotly_plot.cpython-35.pyc
byte-compiling build/bdist.linux-x86_64/egg/tensorwatch/plotly/__init__.py to __init__.cpython-35.pyc
byte-compiling build/bdist.linux-x86_64/egg/tensorwatch/stream_union.py to stream_union.cpython-35.pyc
byte-compiling build/bdist.linux-x86_64/egg/tensorwatch/lv_types.py to lv_types.cpython-35.pyc
byte-compiling build/bdist.linux-x86_64/egg/tensorwatch/filtered_stream.py to filtered_stream.cpython-35.pyc
byte-compiling build/bdist.linux-x86_64/egg/tensorwatch/image_utils.py to image_utils.cpython-35.pyc
byte-compiling build/bdist.linux-x86_64/egg/tensorwatch/receptive_field/rf_utils.py to rf_utils.cpython-35.pyc
byte-compiling build/bdist.linux-x86_64/egg/tensorwatch/receptive_field/__init__.py to __init__.cpython-35.pyc
byte-compiling build/bdist.linux-x86_64/egg/tensorwatch/repeated_timer.py to repeated_timer.cpython-35.pyc
byte-compiling build/bdist.linux-x86_64/egg/tensorwatch/text_vis.py to text_vis.cpython-35.pyc
byte-compiling build/bdist.linux-x86_64/egg/tensorwatch/visualizer.py to visualizer.cpython-35.pyc
byte-compiling build/bdist.linux-x86_64/egg/tensorwatch/array_stream.py to array_stream.cpython-35.pyc
byte-compiling build/bdist.linux-x86_64/egg/tensorwatch/tensor_utils.py to tensor_utils.cpython-35.pyc
byte-compiling build/bdist.linux-x86_64/egg/tensorwatch/vis_base.py to vis_base.cpython-35.pyc
  File "build/bdist.linux-x86_64/egg/tensorwatch/vis_base.py", line 73
    stream_vis:StreamVisInfo = None
              ^
SyntaxError: invalid syntax

byte-compiling build/bdist.linux-x86_64/egg/tensorwatch/imagenet_utils.py to imagenet_utils.cpython-35.pyc
byte-compiling build/bdist.linux-x86_64/egg/tensorwatch/model_graph/torchstat_utils.py to torchstat_utils.cpython-35.pyc
byte-compiling build/bdist.linux-x86_64/egg/tensorwatch/model_graph/hiddenlayer/pytorch_builder.py to pytorch_builder.cpython-35.pyc
byte-compiling build/bdist.linux-x86_64/egg/tensorwatch/model_graph/hiddenlayer/tf_builder.py to tf_builder.cpython-35.pyc
byte-compiling build/bdist.linux-x86_64/egg/tensorwatch/model_graph/hiddenlayer/transforms.py to transforms.cpython-35.pyc
byte-compiling build/bdist.linux-x86_64/egg/tensorwatch/model_graph/hiddenlayer/ge.py to ge.cpython-35.pyc
byte-compiling build/bdist.linux-x86_64/egg/tensorwatch/model_graph/hiddenlayer/graph.py to graph.cpython-35.pyc
byte-compiling build/bdist.linux-x86_64/egg/tensorwatch/model_graph/hiddenlayer/__init__.py to __init__.cpython-35.pyc
byte-compiling build/bdist.linux-x86_64/egg/tensorwatch/model_graph/__init__.py to __init__.cpython-35.pyc
byte-compiling build/bdist.linux-x86_64/egg/tensorwatch/zmq_wrapper.py to zmq_wrapper.cpython-35.pyc
  File "build/bdist.linux-x86_64/egg/tensorwatch/zmq_wrapper.py", line 16
    _thread:Thread = None
           ^
SyntaxError: invalid syntax

byte-compiling build/bdist.linux-x86_64/egg/tensorwatch/pytorch_utils.py to pytorch_utils.cpython-35.pyc
byte-compiling build/bdist.linux-x86_64/egg/tensorwatch/zmq_mgmt_stream.py to zmq_mgmt_stream.cpython-35.pyc
  File "build/bdist.linux-x86_64/egg/tensorwatch/zmq_mgmt_stream.py", line 19
    self._stream_reqs:Dict[str,StreamCreateRequest] = {}
                     ^
SyntaxError: invalid syntax

byte-compiling build/bdist.linux-x86_64/egg/tensorwatch/embeddings/tsne_utils.py to tsne_utils.cpython-35.pyc
byte-compiling build/bdist.linux-x86_64/egg/tensorwatch/embeddings/__init__.py to __init__.cpython-35.pyc
byte-compiling build/bdist.linux-x86_64/egg/tensorwatch/notebook_maker.py to notebook_maker.cpython-35.pyc
byte-compiling build/bdist.linux-x86_64/egg/tensorwatch/watcher_client.py to watcher_client.cpython-35.pyc
byte-compiling build/bdist.linux-x86_64/egg/tensorwatch/evaler_utils.py to evaler_utils.cpython-35.pyc
byte-compiling build/bdist.linux-x86_64/egg/tensorwatch/evaler.py to evaler.cpython-35.pyc
byte-compiling build/bdist.linux-x86_64/egg/tensorwatch/data_utils.py to data_utils.cpython-35.pyc
byte-compiling build/bdist.linux-x86_64/egg/tensorwatch/zmq_stream.py to zmq_stream.cpython-35.pyc
byte-compiling build/bdist.linux-x86_64/egg/tensorwatch/watcher.py to watcher.cpython-35.pyc
byte-compiling build/bdist.linux-x86_64/egg/tensorwatch/stream_factory.py to stream_factory.cpython-35.pyc
  File "build/bdist.linux-x86_64/egg/tensorwatch/stream_factory.py", line 18
    self._streams:Dict[str, Stream] = None
                 ^
SyntaxError: invalid syntax

I try to import the package again and the error is the same.

Python 3.5.2 (default, Nov 12 2018, 13:43:14)
[GCC 5.4.0 20160609] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import tensorwatch
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/data1/shengtao/Project/ceshi2/tensorwatch/tensorwatch/__init__.py", line 6, in <module>
    from .watcher_client import WatcherClient
  File "/data1/shengtao/Project/ceshi2/tensorwatch/tensorwatch/watcher_client.py", line 5, in <module>
    from .zmq_wrapper import ZmqWrapper
  File "/data1/shengtao/Project/ceshi2/tensorwatch/tensorwatch/zmq_wrapper.py", line 16
    _thread:Thread = None
           ^
SyntaxError: invalid syntax

I don't use anaconda but virtualenv.

shengtao96 avatar Jun 17 '19 03:06 shengtao96

What is your OS and Python environment? Are you using non-English version of OS or Python install? I'm suspecting there is something wrong with your Python install.

sytelus avatar Jul 10 '19 15:07 sytelus

I also has this problem, with python3.5 in macOS.

Is it a problem only with python version 3.5?

NeilWangziyu avatar Jul 14 '19 01:07 NeilWangziyu

My OS is Ubuntu 16.06 LTS and python version is 3.5. I'm sure that I install python correctly.

shengtao96 avatar Jul 15 '19 09:07 shengtao96

python3.5.2 has this problem,python3.7.4 can work it.

ischihmo avatar Jul 07 '20 05:07 ischihmo