thrift-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Sundar Nadathur <>
Subject ImportError: No module named thrift.transport
Date Fri, 20 Nov 2015 23:27:46 GMT
Hi all,
    I have found many instances of this error "ImportError: No module named thrift.transport"
in Google. However, running 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*  compat/*  setup.cfg  src/

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

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

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

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/.

   Thrift 0.9.3
   Python 2.7.1



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.

  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message