Skip to content
This repository has been archived by the owner on Aug 4, 2020. It is now read-only.

setup.py imports thrift #84

Closed
jasonbaker opened this issue Sep 27, 2011 · 1 comment
Closed

setup.py imports thrift #84

jasonbaker opened this issue Sep 27, 2011 · 1 comment

Comments

@jasonbaker
Copy link

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
@thobbs thobbs closed this as completed in 3c7ed97 Sep 28, 2011
@thobbs
Copy link
Member

thobbs commented Sep 28, 2011

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 subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants