Hi all,
    I have found many instances of this error "ImportError: No module named 
thrift.transport" in Google. However, running setup.py does not fix the problem 
for me. Please LMK what I should do differently.

Specifically, I have generated Python code from a thrift file, and am trying to 
run the client. Here's the error:
$ ./force_rpc-remote
Traceback (most recent call last):
  File "./force_rpc-remote", line 13, in <module>
    from thrift.transport import TTransport
ImportError: No module named thrift.transport

I have installed the Thrift library under mypath/Thrift/thrift-0.9.3/lib/py:
py $ ls
CMakeLists.txt*  coding_standards.md  compat/  Makefile.am*  Makefile.in  
README.md  setup.cfg  setup.py  src/

I ran setup.py as follows:
py $ sudo python setup.py install
[sudo] password for snadathu:
/tools/share/python/2.7.1/linux64/lib/python2.7/distutils/dist.py:267: 
UserWarning: Unknown distribution option: 'use_2to3'
  warnings.warn(msg)
running install

However, it seems to return an error status:
py $ echo $?
139

I tried modifying setup.py as below, with no difference:
setup(name = 'thrift', . . .
        # use_2to3 = True,
        use_2to3 = False,
        **extensions
    )

Subsequently, as expected, force_rpc-remote throws ImportError. Please note 
that I have set PYTHONPATH to include both mypath/Thrift/thrift-0.9.3/lib/py 
and mypath/Thrift/thrift-0.9.3/lib/py/src/.

Details:
   Thrift 0.9.3
   Python 2.7.1

Cheers,
Sundar


________________________________

Confidentiality Notice.
This message may contain information that is confidential or otherwise 
protected from disclosure. If you are not the intended recipient, you are 
hereby notified that any use, disclosure, dissemination, distribution, or 
copying of this message, or any attachments, is strictly prohibited. If you 
have received this message in error, please advise the sender by reply e-mail, 
and delete the message and any attachments. Thank you.

Reply via email to