Setup python development environment for Steem on Ubuntu 16

yuxi(61)
Published in
#steem
Words
117
Reading
1 min
Listen
Play
9y

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:

sudo apt-get update
sudo apt-get -y upgrade

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

python -v

You also need to install pip to manage software packages:

sudo apt-get install -y python3-pip

Install development libraries:

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

Setting up a virtual environment

sudo apt-get install python3-venv
mkdir environments
cd environments
python3 -m venv myenv
source myenv/bin/activate

Setting up python steem libraries

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:

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

Originally posted on https://steemit.com. Thank you for reading my post, feel free to FOLLOW and Upvote yuxi@yuxi, which will motivate me to create more quality posts.

Setup python development environment for Steem on Ubuntu 16 | Ecency