tensorflow / skflow

Simplified interface for TensorFlow (mimicking Scikit Learn) for Deep Learning
Apache License 2.0
3.18k stars 439 forks source link

python setup.py install broke other packages in os X #49

Closed boscotsang closed 8 years ago

boscotsang commented 8 years ago

When I run the python setup.py install the first time it went well but after I ran the python setup.py installl all the modules that skflow depends to were broken. The following is the detail information.

Python 2.7.11 (default, Dec 23 2015, 12:23:20) 
[GCC 4.2.1 Compatible Apple LLVM 7.0.2 (clang-700.1.81)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> import numpy
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/Users/tsangbosco/.pyenv/versions/2.7.11/lib/python2.7/site-packages/numpy/__init__.py", line 180, in <module>
    from . import add_newdocs
  File "/Users/tsangbosco/.pyenv/versions/2.7.11/lib/python2.7/site-packages/numpy/add_newdocs.py", line 13, in <module>
    from numpy.lib import add_newdoc
  File "/Users/tsangbosco/.pyenv/versions/2.7.11/lib/python2.7/site-packages/numpy/lib/__init__.py", line 8, in <module>
    from .type_check import *
  File "/Users/tsangbosco/.pyenv/versions/2.7.11/lib/python2.7/site-packages/numpy/lib/type_check.py", line 11, in <module>
    import numpy.core.numeric as _nx
  File "/Users/tsangbosco/.pyenv/versions/2.7.11/lib/python2.7/site-packages/numpy/core/__init__.py", line 58, in <module>
    from numpy.testing import Tester
  File "/Users/tsangbosco/.pyenv/versions/2.7.11/lib/python2.7/site-packages/numpy/testing/__init__.py", line 14, in <module>
    from .utils import *
  File "/Users/tsangbosco/.pyenv/versions/2.7.11/lib/python2.7/site-packages/numpy/testing/utils.py", line 15, in <module>
    from tempfile import mkdtemp
  File "/Users/tsangbosco/.pyenv/versions/2.7.11/lib/python2.7/tempfile.py", line 32, in <module>
    import io as _io
  File "build/bdist.macosx-10.11-x86_64/egg/io/__init__.py", line 16, in <module>

  File "skflow/__init__.py", line 17, in <module>
    import tensorflow as tf
  File "/Users/tsangbosco/.pyenv/versions/2.7.11/lib/python2.7/site-packages/tensorflow/__init__.py", line 23, in <module>
    from tensorflow.python import *
  File "/Users/tsangbosco/.pyenv/versions/2.7.11/lib/python2.7/site-packages/tensorflow/python/__init__.py", line 43, in <module>
    raise ImportError(msg)
ImportError: Traceback (most recent call last):
  File "/Users/tsangbosco/.pyenv/versions/2.7.11/lib/python2.7/site-packages/tensorflow/python/__init__.py", line 37, in <module>
    from tensorflow.core.framework.graph_pb2 import *
  File "/Users/tsangbosco/.pyenv/versions/2.7.11/lib/python2.7/site-packages/tensorflow/core/framework/graph_pb2.py", line 8, in <module>
    from google.protobuf import reflection as _reflection
  File "/Users/tsangbosco/.pyenv/versions/2.7.11/lib/python2.7/site-packages/google/protobuf/reflection.py", line 58, in <module>
    from google.protobuf.internal import python_message as message_impl
  File "/Users/tsangbosco/.pyenv/versions/2.7.11/lib/python2.7/site-packages/google/protobuf/internal/python_message.py", line 53, in <module>
    from io import BytesIO
ImportError: cannot import name BytesIO
ilblackdragon commented 8 years ago

It's weird that you are importing stuff from build/bdist.macosx-10.11-x86_64/egg/ . Which folder are you running your python from? If you are in clonned folder you called setup.py install - try changing directory. Also try checking how your $PYTHONPATH looks like - it shouldn't have that directory in the list.

boscotsang commented 8 years ago

I ran the python in any other folders the same error came. The following is the detail information about the $PYTHONPATH and the traceback when I ran the python in home directory.

TsangBosco:~ tsangbosco$ python
Python 2.7.11 (default, Dec 23 2015, 12:23:20) 
[GCC 4.2.1 Compatible Apple LLVM 7.0.2 (clang-700.1.81)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> import numpy
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/Users/tsangbosco/.pyenv/versions/2.7.11/lib/python2.7/site-packages/numpy/__init__.py", line 180, in <module>
    from . import add_newdocs
  File "/Users/tsangbosco/.pyenv/versions/2.7.11/lib/python2.7/site-packages/numpy/add_newdocs.py", line 13, in <module>
    from numpy.lib import add_newdoc
  File "/Users/tsangbosco/.pyenv/versions/2.7.11/lib/python2.7/site-packages/numpy/lib/__init__.py", line 8, in <module>
    from .type_check import *
  File "/Users/tsangbosco/.pyenv/versions/2.7.11/lib/python2.7/site-packages/numpy/lib/type_check.py", line 11, in <module>
    import numpy.core.numeric as _nx
  File "/Users/tsangbosco/.pyenv/versions/2.7.11/lib/python2.7/site-packages/numpy/core/__init__.py", line 58, in <module>
    from numpy.testing import Tester
  File "/Users/tsangbosco/.pyenv/versions/2.7.11/lib/python2.7/site-packages/numpy/testing/__init__.py", line 14, in <module>
    from .utils import *
  File "/Users/tsangbosco/.pyenv/versions/2.7.11/lib/python2.7/site-packages/numpy/testing/utils.py", line 15, in <module>
    from tempfile import mkdtemp
  File "/Users/tsangbosco/.pyenv/versions/2.7.11/lib/python2.7/tempfile.py", line 32, in <module>
    import io as _io
  File "build/bdist.macosx-10.11-x86_64/egg/io/__init__.py", line 16, in <module>
ImportError: No module named skflow.io.pandas_io
>>> exit()
TsangBosco:~ tsangbosco$ echo $PYTHONPATH
/Users/tsangbosco/.pyenv/version/2.7.11
ilblackdragon commented 8 years ago

What about sys.path? I'm just not observing the same issue myself and this line File "build/bdist.macosx-10.11-x86_64/egg/io/__init__.py", line 16, in <module> seems like an issue where the skflow got installed.

I just did next commands:

mkdir temp
virtualenv env
source env/bin/activate
git clone https://github.com/google/skflow.git
pip install numpy
pip install scipy
pip install sklearn
pip install --upgrade https://storage.googleapis.com/tensorflow/mac/tensorflow-0.6.0-py2-none-any.whl
cd skflow
python setup.py install

and then tried import numpy in python and it works correctly.

terrytangyuan commented 8 years ago

Closing this due to inactive status. Feel free to reopen it if you encounter the problem again.