tensorboard icon indicating copy to clipboard operation
tensorboard copied to clipboard

ImportError: _pywrap_tensorflow.so: Symbol not found: _PyBytes_AsString

Open petertulala opened this issue 8 years ago • 13 comments

I've tried to install tensorboard on Python 3.6 (macOS Sierra 10.12.6) both using pip3 install tensorboard or build from source. In both cases I'm getting this error:

> tensorboard --logdir=/tmp/tb
Traceback (most recent call last):
  File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/tensorboard/tensorboard.runfiles/org_tensorflow/tensorflow/tensorboard/tensorboard.py", line 32, in <module>
    from tensorflow.python.summary import event_file_inspector as efi
  File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/tensorboard/tensorboard.runfiles/org_tensorflow/tensorflow/python/summary/event_file_inspector.py", line 122, in <module>
    from tensorflow.python.platform import gfile
  File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/tensorboard/tensorboard.runfiles/org_tensorflow/tensorflow/python/platform/gfile.py", line 22, in <module>
    from tensorflow.python.lib.io.file_io import copy as Copy
  File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/tensorboard/tensorboard.runfiles/org_tensorflow/tensorflow/python/lib/io/file_io.py", line 27, in <module>
    from tensorflow.python import pywrap_tensorflow
  File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/tensorboard/tensorboard.runfiles/org_tensorflow/tensorflow/python/pywrap_tensorflow.py", line 28, in <module>
    _pywrap_tensorflow = swig_import_helper()
  File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/tensorboard/tensorboard.runfiles/org_tensorflow/tensorflow/python/pywrap_tensorflow.py", line 24, in swig_import_helper
    _mod = imp.load_module('_pywrap_tensorflow', fp, pathname, description)
ImportError: dlopen(/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/tensorboard/tensorboard.runfiles/org_tensorflow/tensorflow/python/_pywrap_tensorflow.so, 2): Symbol not found: _PyBytes_AsString
  Referenced from: /Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/tensorboard/tensorboard.runfiles/org_tensorflow/tensorflow/python/_pywrap_tensorflow.so
  Expected in: flat namespace
 in /Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/tensorboard/tensorboard.runfiles/org_tensorflow/tensorflow/python/_pywrap_tensorflow.so

Did I miss something?

Related issue on stackoverflow (not resolved): https://stackoverflow.com/questions/44895394/cant-run-tensorboard-because-of-symbol-not-found-pybytes-asstring

petertulala avatar Aug 17 '17 14:08 petertulala

It works fine in Python2.7, have you verified this?

zihaolucky avatar Aug 24 '17 15:08 zihaolucky

Same error in Python3.5.

SamaelChen avatar Aug 30 '17 02:08 SamaelChen

Same error here, I installed tensorboard on Debian, I did a native install with pip3 and it never worked. This is the log error:

$ tensorboard
Traceback (most recent call last):
  File "/usr/local/lib/python3.5/dist-packages/tensorboard/tensorboard.runfiles/org_tensorflow/tensorflow/tensorboard/tensorboard.py", line 32, in <module>
    from tensorflow.python.summary import event_file_inspector as efi
  File "/usr/local/lib/python3.5/dist-packages/tensorboard/tensorboard.runfiles/org_tensorflow/tensorflow/python/summary/event_file_inspector.py", line 122, in <module>
    from tensorflow.python.platform import gfile
  File "/usr/local/lib/python3.5/dist-packages/tensorboard/tensorboard.runfiles/org_tensorflow/tensorflow/python/platform/gfile.py", line 22, in <module>
    from tensorflow.python.lib.io.file_io import copy as Copy
  File "/usr/local/lib/python3.5/dist-packages/tensorboard/tensorboard.runfiles/org_tensorflow/tensorflow/python/lib/io/file_io.py", line 27, in <module>
    from tensorflow.python import pywrap_tensorflow
  File "/usr/local/lib/python3.5/dist-packages/tensorboard/tensorboard.runfiles/org_tensorflow/tensorflow/python/pywrap_tensorflow.py", line 28, in <module>
    _pywrap_tensorflow = swig_import_helper()
  File "/usr/local/lib/python3.5/dist-packages/tensorboard/tensorboard.runfiles/org_tensorflow/tensorflow/python/pywrap_tensorflow.py", line 24, in swig_import_helper
    _mod = imp.load_module('_pywrap_tensorflow', fp, pathname, description)
ImportError: /usr/local/lib/python3.5/dist-packages/tensorboard/tensorboard.runfiles/org_tensorflow/tensorflow/python/_pywrap_tensorflow.so: undefined symbol: PyBytes_AsStringAndSize```

usr-ein avatar Sep 02 '17 21:09 usr-ein

same error

Jfeng3 avatar Sep 06 '17 18:09 Jfeng3

same error. Is there a fix for this?

renukemendis avatar Sep 16 '17 17:09 renukemendis

I am getting the same error on macOS Sierra 10.12.6, Python 3.5.1

arorahardeep avatar Sep 17 '17 13:09 arorahardeep

I am getting the same error. Is there any fix for this?

jonbronson avatar Sep 17 '17 19:09 jonbronson

I was able to get tensorflow-tensorboard working on Ubuntu 16.04 as well as OS X (Sierra), (until tensorboard is officially supported with tensorflow 1.3):

Here's what I did:

Step 1: uninstall tensorboard

pip3 uninstall tensorboard

Step 2: install tensorflow-tensorboard

pip3 install tensorflow-tensorboard

Step 3: verify installation

pip3 list | grep tensor

tensorflow-gpu (1.3.0) tensorflow-tensorboard (0.1.6)

Step 4: Run tensoboard with your directory...

tensorboard --logdir=

renukemendis avatar Sep 18 '17 03:09 renukemendis

Hey guys, it is said that Google asked them stopping work on this project. So, this bug may not be fixed.

SamaelChen avatar Sep 18 '17 09:09 SamaelChen

I recommend you guys try building it from source. It looks like something wrong during compile the backend, which we didn't change the code.

zihaolucky avatar Sep 18 '17 11:09 zihaolucky

@SamaelChen We're stilling working in this project, trying to provide a framework independent TensorBoard. We just remove the PyPI and don't use the name tensorboard in PyPI anymore.

BTW, I'm trying another way to compile stand-alone TensorBoard based on tensorflow/tensorbaord, refer here https://github.com/zihaolucky/tensorboard-lite if you want, the code in master branch works same as the functions we've provided. (The code there is for experiment, we would merge the code back to here after we stabilize the code) And we're going to support embedding and more features. Thanks!

zihaolucky avatar Sep 18 '17 11:09 zihaolucky

same error

bo-ke avatar Oct 31 '17 13:10 bo-ke

@poem0207 Did you use the latest code in master?

zihaolucky avatar Nov 01 '17 11:11 zihaolucky