Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

setup.py imports thrift #84

Closed
jasonbaker opened this Issue · 1 comment

2 participants

Jason Baker Tyler Hobbs
Jason Baker

Pycassa's setup.py file imports thrift, which is not a good idea considering that thrift is a dependency and isn't necessarily installed when the setup.py file is run. This makes it really difficult to install pycassa from a pip requirements file as it will run python setup.py egg_info on every package before it tries to install it, even if I list it as

% pip uninstall pycassa

Uninstalling pycassa:
  /home/jason/src/apture/bin/pycassaShell
  /home/jason/src/apture/lib/python2.7/site-packages/ez_setup.py
  /home/jason/src/apture/lib/python2.7/site-packages/pycassa
  /home/jason/src/apture/lib/python2.7/site-packages/pycassa-1.1.0-py2.7.egg-info
Proceed (y/n)? y
  Successfully uninstalled pycassa


% pip uninstall thrift
Uninstalling thrift:
  /home/jason/src/apture/lib/python2.7/site-packages/thrift
  /home/jason/src/apture/lib/python2.7/site-packages/thrift-0.7.0-py2.7.egg-info
Proceed (y/n)? y
  Successfully uninstalled thrift

% pip install pycassa
Downloading/unpacking pycassa
  Downloading pycassa-1.2.1.tar.gz (77Kb): 77Kb downloaded
  Running setup.py egg_info for package pycassa
    Traceback (most recent call last):
      File "<string>", line 14, in <module>
      File "/home/jason/src/apture/build/pycassa/setup.py", line 27, in <module>
        import pycassa
      File "pycassa/__init__.py", line 1, in <module>
        from pycassa.columnfamily import *
      File "pycassa/columnfamily.py", line 13, in <module>
        from pycassa.cassandra.ttypes import Column, ColumnOrSuperColumn,\
      File "pycassa/cassandra/ttypes.py", line 1, in <module>
        from pycassa.cassandra.c08.ttypes import *
      File "pycassa/cassandra/c08/ttypes.py", line 7, in <module>
        from thrift.Thrift import *
    ImportError: No module named thrift.Thrift
    Complete output from command python setup.py egg_info:
    Traceback (most recent call last):

  File "<string>", line 14, in <module>

  File "/home/jason/src/apture/build/pycassa/setup.py", line 27, in <module>

    import pycassa

  File "pycassa/__init__.py", line 1, in <module>

    from pycassa.columnfamily import *

  File "pycassa/columnfamily.py", line 13, in <module>

    from pycassa.cassandra.ttypes import Column, ColumnOrSuperColumn,\

  File "pycassa/cassandra/ttypes.py", line 1, in <module>

    from pycassa.cassandra.c08.ttypes import *

  File "pycassa/cassandra/c08/ttypes.py", line 7, in <module>

    from thrift.Thrift import *

ImportError: No module named thrift.Thrift

----------------------------------------
Command python setup.py egg_info failed with error code 1
Storing complete log in /home/jason/.pip/pip.log
Tyler Hobbs
Owner

Definitely an unintended consequence! Thanks for reporting this.

I've fixed the issue in master and uploaded a 1.2.1-2 version to pypi that fixes this. Let me know if everything doesn't work for you.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.