Setup python development environment for Steem on Ubuntu 16

Python & Steem

Install python 3

Both Python 3 and Python 2 have been pre-installed on Ubuntu 16, you just need to make sure you have the latest versions by running:

1
2
sudo apt-get update
sudo apt-get -y upgrade

Then run the following command to check the version of Python 3:

1
python -v

You also need to install pip to manage software packages:

1
sudo apt-get install -y python3-pip

Install development libraries:

1
sudo apt-get install build-essential libffi-dev libssl-dev python3-dev

Setting up a virtual environment

1
2
3
4
5
sudo apt-get install python3-venv
mkdir environments
cd environments
python3 -m venv myenv
source myenv/bin/activate

Setting up python steem libraries

1
2
3
pip3 install wheel
pip3 install piston-lib
pip3 install steem

Test it works

To test the development environment has been set up correctly, run the following script to list the tags used by latest posts:

1
2
3
4
5
from piston import Steem
steem = Steem()
for c in steem.stream_comments():
if c.is_main_post():
print (c.meta["tags"])

@yuxi

Thank you for reading my post, feel free to FOLLOW and Upvote @yuxi, which will motivate me to create more quality posts.

Share