The road to compiling to Python 3 with Thrift

I thought that Thrift doesn't support python3, so I looked it up.

https://issues.apache.org/jira/browse/THRIFT-1857 That? Issue is fixed and closed, but this is ...

If you take a closer look, it is supported by ver 0.10.0, but since the latest version is currently 0.9.3 (as of November 23, 2016), it cannot be compiled into python3. It seems that you have to check out the latest version ...

check out

git clone https://github.com/apache/thrift.git

git branch -a // Check for existing branch git checkout -b 0.10.0 remotes/origin/0.10.0

Install what you need when making

All the "Requirements for building from source" here http://thrift.apache.org/docs/install/

sudo apt-get update
sudo apt-get install libboost-dev libboost-test-dev libboost-program-options-dev libboost-filesystem-dev libboost-thread-dev libevent-dev automake libtool flex bison pkg-config g++ libssl-dev

Then follow the README

https://github.com/apache/thrift/tree/0.10.0

./bootstrap.sh
./configure
sudo make
sudo make install

Operation check

Confirm Thrift installation

thrift -version

If "Thrift version 0.10.0" is printed, the installation is successful.

thrift -r --gen py test.thrift

The "py-gen" directory has been successfully created! You can also import from python3.5.

I mean ... I felt that the road to python3 was still a long way off.

Supplement

It seems that even if you use something called thriftpy, it can support python 3 series. https://github.com/eleme/thriftpy

I don't know when the release version of 0.10.0 will come out, but if the only purpose is to compile to python3 I personally think that I don't have to use it.

Recommended Posts

The road to compiling to Python 3 with Thrift
The road to Pythonista
The road to Djangoist
The easiest way to synthesize speech with python
Try to solve the man-machine chart with Python
Specify the Python executable to use with virtualenv
Say hello to the world with Python with IntelliJ
The easiest way to use OpenCV with python
Introduction to Python with Atom (on the way)
Connect to BigQuery with Python
Try to solve the programming challenge book with python3
A road to intermediate Python
[Introduction to Python] How to iterate with the range function?
Try to solve the internship assignment problem with Python
The first algorithm to learn with Python: FizzBuzz problem
I tried to touch the CSV file with Python
The road to download Matplotlib
Connect to Wikipedia with Python
Post to slack with Python 3
[Python] How to specify the download location with youtube-dl
Convert the image in .zip to PDF with Python
I want to inherit to the back with python dataclass
The road to updating Splunkbase with your own Splunk app for Python v2 / v3
Specify MinGW as the compiler to use with Python
I tried to solve the problem with Python Vol.1
[Python] How to rewrite the table style with python-pptx [python-pptx]
Call the API with python3.
[Python] Road to a snake charmer (5) Play with Matplotlib
I tried to find the entropy of the image with python
I tried to simulate how the infection spreads with Python
[Road to intermediate Python] Install packages in bulk with pip
I wanted to solve the Panasonic Programming Contest 2020 with Python
The first API to make with python Djnago REST framework
Minimum knowledge to get started with the Python logging module
Probably the easiest way to create a pdf with Python3
[Part.2] Crawling with Python! Click the web page to move!
[Python] I want to use the -h option with argparse
[Road to intermediate Python] Enables comparison operations with original classes
How to get into the python development environment with Vagrant
[Python] The first step to making a game with Pyxel
Save images on the web to Drive with Python (Colab)
I tried to divide the file into folders with Python
Try to decipher the garbled attachment file name with Python
[Introduction to Python] How to get data with the listdir function
Get the source of the page to load infinitely with python.
Road to the Wizard: 4th Step
Leave the troublesome processing to Python
Extract the xz file with python
Python: How to use async with
Link to get started with python
[Python] Write to csv file with Python
Create folders from '01' to '12' with python
Try to operate Facebook with Python
Pave the road with combinatorial optimization
Output to csv file with Python
Get the weather with Python requests
Get the weather with Python requests 2
In the python command python points to python3.8
How to get the Python version
Convert list to DataFrame with python
Find the Levenshtein Distance with python