create account

体验“在Ubuntu 16上配置Python和Steem开发环境“(二) by liuzg

View this thread on: hive.blogpeakd.comecency.com
· @liuzg · (edited)
$2.43
体验“在Ubuntu 16上配置Python和Steem开发环境“(二)
<center><img src="https://ipfs.busy.org/ipfs/QmQYqd91dQKfVswTApg5KFkAU7WDCnbfj5SYSeU4sSQF7S" alt="ubuntu-python-steem.png" /><br/><br/><a href="https://cn.yuxifan.com/setup-python-steem-development-environment-ubuntu16/">图源:范羽西博客</a></center>

> *六天前,我在[《体验“在Ubuntu 16上配置Python和Steem开发环境“》](https://busy.org/@liuzg/ubuntu16pythonsteem-gavm4ocp9i)一文中记录了我第一次在ubuntu配置Python和Steem开发环境。在编程方面我是一个门外汉,我的编程语言水平只停留在大学时的几次计算机课上,对linux、python更是白纸一张。因为是个门外汉,那次的体验可想而知,最后以失败告终。*
>
> *昨天晚上,我再次尝试了一次在Ubuntu 16上配置Python和Steem开发环境。虽然过程有点曲折,但是最后却成功了。*<br/><br/>***下面是我对我的操作过程的记录。***

### 对第一次失败的思考

在第一次配置过程中,最后出现的问题是找不到模块错误(ModuleNotFoundError)。出现这个问题,很可能是因为我们使用的steem开发软件包“steem-python”这个项目没有及时维护更新。

**为什么这么说?**

在github上,steem开发软件包[“steem-python”项目](https://github.com/steemit/steem-python)的更新还停留在2018年3月23日。在2018年6月,steem进行过一次硬分叉,这次的分叉很可能就是ModuleNotFoundError问题的元凶。

**怎么解决?**

我在网上搜索时,发现github上还有另一个steem开发软件包[“beem”项目](https://github.com/holgern/beem),它的更新时间是2019年4月19日。可以看出这个项目更新的非常及时,我决定用这个项目试一试。

### 具体步骤

1、配置Python和Steem开发环境

根据我之前的[帖子](https://busy.org/editor?draft=liuzg/ubuntu16pythonsteem-gavm4ocp9i),结合github上[“beem”项目](https://github.com/holgern/beem)的README文件完成Python和Steem开发环境的配置。

2、测试开发环境<br/>*(接下来的过程是按照@emrebeyler的post[《Beem Tutorials #1 - Introduction to Beem and creating a post with it》](https://steemit.com/utopian-io/@emrebeyler/beem-tutorials-1-introduction-to-beem-and-creating-a-post-with-it)完成。)*

a、打开shell进入虚拟运行环境
![2019-05-29 10-43-46屏幕截图.png](https://cdn.steemitimages.com/DQmSCu3jwzCdUoc7rXCTayy71x2UNFpRkCCM6N1qdB63n8c/2019-05-29%2010-43-46%E5%B1%8F%E5%B9%95%E6%88%AA%E5%9B%BE.png)

b、打开python
![2019-05-29 10-46-02屏幕截图.png](https://cdn.steemitimages.com/DQmTHmLXXhkWEWHkdWnS3bQtwmCJ2ecHudhGkMzeKZUytTg/2019-05-29%2010-46-02%E5%B1%8F%E5%B9%95%E6%88%AA%E5%9B%BE.png)

c、测试steem链的版本
```python
from beem import Steem
s = Steem()

print(s.get_blockchain_version())
```
![2019-05-29 10-46-24屏幕截图.png](https://cdn.steemitimages.com/DQmYHjBEiFm2JmfhLV3AQrYEP9uJzz3JvL7eqX6aMP9pcBL/2019-05-29%2010-46-24%E5%B1%8F%E5%B9%95%E6%88%AA%E5%9B%BE.png)

当我执行到```s = Steem()```的时候,第一个错误出现(如上图)。

出现这个问题以后,我在网上没有找到答案,我猜想这个错误可能与api.steemit.com在国内被屏蔽有关。于是进入下一步:设置节点。

d、设置节点(Setting a node)
```python
from beem import Steem
s = Steem(
    node=["https://api.steemit.com",]
)
```
![2019-05-29 10-58-54屏幕截图.png](https://cdn.steemitimages.com/DQmdk4ABGhj57ZFKKFE6xrHfA4Nc3dpLu6DXwZzj8snDyMM/2019-05-29%2010-58-54%E5%B1%8F%E5%B9%95%E6%88%AA%E5%9B%BE.png)
同样出现问题,原因还是出在api.steemit.com节点。最后我把steemit节点换成国内可用的anyx.io,执行``` s = Steem(node=["https://anyx.io",])```问题解决。

执行上一步中测试steem区块链版本号```print(s.get_blockchain_version())```,显示当前版本为:```0.20.10```。
![2019-05-29 11-11-16屏幕截图.png](https://cdn.steemitimages.com/DQmY1nN4ESAu6tomidbPk7WV2JZFaRjNZXpGRJYQCgkRRu5/2019-05-29%2011-11-16%E5%B1%8F%E5%B9%95%E6%88%AA%E5%9B%BE.png)

### 到现在为止,在Ubuntu 16上配置Python和Steem开发环境顺利完成!!!

3、下面是我通过调试完成的开发环境发出的第一个测试帖子。

shell终端显示如下:
![2019-05-29 11-21-04屏幕截图.png](https://cdn.steemitimages.com/DQmNkPPWhU7c2HhA44sprjjCGVWDB32M4nQNbDR4wPQrLTT/2019-05-29%2011-21-04%E5%B1%8F%E5%B9%95%E6%88%AA%E5%9B%BE.png)

busy.org显示如下:![2019-05-29 11-23-02屏幕截图.png](https://cdn.steemitimages.com/DQmPUoKmP8XoRGgTZoCuy2YKejxHF1CL2dtrNoZPx4f8MpU/2019-05-29%2011-23-02%E5%B1%8F%E5%B9%95%E6%88%AA%E5%9B%BE.png)
👍  , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , and 340 others
properties (23)
authorliuzg
permlinkubuntu-16-python-steem
categorysct
json_metadata{"links":["https://cn.yuxifan.com/setup-python-steem-development-environment-ubuntu16/","https://busy.org/@liuzg/ubuntu16pythonsteem-gavm4ocp9i","https://github.com/steemit/steem-python","https://github.com/holgern/beem","https://busy.org/editor?draft=liuzg/ubuntu16pythonsteem-gavm4ocp9i","https://github.com/holgern/beem","/@emrebeyler","https://steemit.com/utopian-io/@emrebeyler/beem-tutorials-1-introduction-to-beem-and-creating-a-post-with-it"],"image":["https://ipfs.busy.org/ipfs/QmQYqd91dQKfVswTApg5KFkAU7WDCnbfj5SYSeU4sSQF7S","https://cdn.steemitimages.com/DQmSCu3jwzCdUoc7rXCTayy71x2UNFpRkCCM6N1qdB63n8c/2019-05-29%2010-43-46%E5%B1%8F%E5%B9%95%E6%88%AA%E5%9B%BE.png","https://cdn.steemitimages.com/DQmTHmLXXhkWEWHkdWnS3bQtwmCJ2ecHudhGkMzeKZUytTg/2019-05-29%2010-46-02%E5%B1%8F%E5%B9%95%E6%88%AA%E5%9B%BE.png","https://cdn.steemitimages.com/DQmYHjBEiFm2JmfhLV3AQrYEP9uJzz3JvL7eqX6aMP9pcBL/2019-05-29%2010-46-24%E5%B1%8F%E5%B9%95%E6%88%AA%E5%9B%BE.png","https://cdn.steemitimages.com/DQmdk4ABGhj57ZFKKFE6xrHfA4Nc3dpLu6DXwZzj8snDyMM/2019-05-29%2010-58-54%E5%B1%8F%E5%B9%95%E6%88%AA%E5%9B%BE.png","https://cdn.steemitimages.com/DQmY1nN4ESAu6tomidbPk7WV2JZFaRjNZXpGRJYQCgkRRu5/2019-05-29%2011-11-16%E5%B1%8F%E5%B9%95%E6%88%AA%E5%9B%BE.png","https://cdn.steemitimages.com/DQmNkPPWhU7c2HhA44sprjjCGVWDB32M4nQNbDR4wPQrLTT/2019-05-29%2011-21-04%E5%B1%8F%E5%B9%95%E6%88%AA%E5%9B%BE.png","https://cdn.steemitimages.com/DQmPUoKmP8XoRGgTZoCuy2YKejxHF1CL2dtrNoZPx4f8MpU/2019-05-29%2011-23-02%E5%B1%8F%E5%B9%95%E6%88%AA%E5%9B%BE.png"],"tags":["sct","sct-cn","cn","esteem-cn","cn-stem"],"app":"busy/2.5.6","format":"markdown","community":"busy","users":["liuzg","emrebeyler"]}
created2019-05-29 08:31:03
last_update2019-05-29 15:12:24
depth0
children10
last_payout2019-06-05 08:31:03
cashout_time1969-12-31 23:59:59
total_payout_value1.824 HBD
curator_payout_value0.605 HBD
pending_payout_value0.000 HBD
promoted0.000 HBD
body_length3,269
author_reputation20,078,417,529,815
root_title"体验“在Ubuntu 16上配置Python和Steem开发环境“(二)"
beneficiaries
0.
accountesteemapp
weight1,000
max_accepted_payout1,000,000.000 HBD
percent_hbd10,000
post_id85,674,372
net_rshares4,638,645,945,749
author_curate_reward""
vote details (404)
@blissfish ·
<div class="pull-right"><img src='https://steemitimages.com/p/3jpR3paJ37V8JxyWvos7Po3CcsKfhvxkGk9C7hMZ8ZbCK1qDQAmGpBxKmZSbBFJn4XdxrGG4PVf8ZSGsDVQ6EHFUndnFsTWGvjKk6yBMna4egroJtLciGzQ1DDf7ePzDnjKHY?format=match&mode=fit&width=640'></div><div><center><h1>Congratulations!</h1><br>This post has been granted a 100% upvote, courtesy to @wokeprincess, from BlissFish!<br>Enjoy the Bliss!<br><hr><a href='https://discord.gg/gqWDz9U'> Join us on Discord!</a></center><blockquote>Upvote this post to help the minnows win a bigger upvote!</blockquote></div>
properties (22)
authorblissfish
permlink20190530t054748901z
categorysct
json_metadata{"tags":["blissfish","bot","lottery","yourewelcome"]}
created2019-05-30 05:47:48
last_update2019-05-30 05:47:48
depth1
children0
last_payout2019-06-06 05:47:48
cashout_time1969-12-31 23:59:59
total_payout_value0.000 HBD
curator_payout_value0.000 HBD
pending_payout_value0.000 HBD
promoted0.000 HBD
body_length547
author_reputation3,706,960,754,901
root_title"体验“在Ubuntu 16上配置Python和Steem开发环境“(二)"
beneficiaries[]
max_accepted_payout1,000,000.000 HBD
percent_hbd10,000
post_id85,732,939
net_rshares0
@cnbuddy ·
吃了吗?这是哪里?你是谁?我为什么会来这边?你不要给我点赞不要点赞,哈哈哈哈哈哈。如果不想再收到我的留言,请回复“取消”。
properties (22)
authorcnbuddy
permlinkre-liuzg-ubuntu-16-python-steem-20190529t225351257z
categorysct
json_metadata""
created2019-05-29 22:53:51
last_update2019-05-29 22:53:51
depth1
children0
last_payout2019-06-05 22:53:51
cashout_time1969-12-31 23:59:59
total_payout_value0.000 HBD
curator_payout_value0.000 HBD
pending_payout_value0.000 HBD
promoted0.000 HBD
body_length61
author_reputation-1,449,160,991,441
root_title"体验“在Ubuntu 16上配置Python和Steem开发环境“(二)"
beneficiaries[]
max_accepted_payout1,000,000.000 HBD
percent_hbd10,000
post_id85,715,621
net_rshares0
@curationkiwi ·
title
You got voted by @curationkiwi thanks to liuzg! This bot is managed by [KiwiJuce3](https://bit.ly/2HQOvIO) and run by [Rishi556](https://bit.ly/2OmBsQF), you can check both of them out there. To receive upvotes on your own posts, you need to join the [Kiwi Co. Discord](https://bit.ly/2U8Mo9M) and go to the room named #CurationKiwi. Submit your post there using the command  "!upvote (post link)" to receive upvotes on your post. CurationKiwi is currently supported by donations from users like you, so feel free to leave an upvote on our posts or comments to support us!
We have also recently added a new whitelist feature for those who would like to support CurationKiwi even more! If you would like to receive upvotes more than 2x greater than the normal upvote, all you need to do is delegate 50 SP to @CurationKiwi using [this link](https://app.steemconnect.com/sign/delegateVestingShares?delegator=&delegatee=curationkiwi&vesting_shares=110000%20VESTS).
properties (22)
authorcurationkiwi
permlinkre-ubuntu-16-python-steem
categorysct
json_metadata{"app":"Discord"}
created2019-05-30 04:08:27
last_update2019-05-30 04:08:27
depth1
children1
last_payout2019-06-06 04:08:27
cashout_time1969-12-31 23:59:59
total_payout_value0.000 HBD
curator_payout_value0.000 HBD
pending_payout_value0.000 HBD
promoted0.000 HBD
body_length960
author_reputation1,922,388,472,606
root_title"体验“在Ubuntu 16上配置Python和Steem开发环境“(二)"
beneficiaries[]
max_accepted_payout1,000,000.000 HBD
percent_hbd10,000
post_id85,728,812
net_rshares0
@tipu ·
<p>Hi @curationkiwi! Special squad of highly trained hamsters prepared this delegation link for you:<br><strong><a href="https://steemconnect.com/sign/delegateVestingShares?account=curationkiwi&delegatee=curationkiwi&vesting_shares=99644.000000%20VESTS">steemconnect 50.0 SP delegation to @curationkiwi</a></strong>.</p>
properties (22)
authortipu
permlinkre-re-ubuntu-16-python-steem-20190530t040837
categorysct
json_metadata""
created2019-05-30 04:08:39
last_update2019-05-30 04:08:39
depth2
children0
last_payout2019-06-06 04:08:39
cashout_time1969-12-31 23:59:59
total_payout_value0.000 HBD
curator_payout_value0.000 HBD
pending_payout_value0.000 HBD
promoted0.000 HBD
body_length320
author_reputation55,940,175,709,939
root_title"体验“在Ubuntu 16上配置Python和Steem开发环境“(二)"
beneficiaries[]
max_accepted_payout1,000,000.000 HBD
percent_hbd10,000
post_id85,728,821
net_rshares0
@drotto ·
<p>This post has received a 1.56 % upvote from @drotto thanks to: @curationkiwi.</p>
properties (22)
authordrotto
permlinkre-liuzg-ubuntu-16-python-steem-20190530t041436463z
categorysct
json_metadata{"tags":["sct"],"app":"drotto/0.0.5pre2"}
created2019-05-30 04:14:36
last_update2019-05-30 04:14:36
depth1
children0
last_payout2019-06-06 04:14:36
cashout_time1969-12-31 23:59:59
total_payout_value0.000 HBD
curator_payout_value0.000 HBD
pending_payout_value0.000 HBD
promoted0.000 HBD
body_length85
author_reputation419,916,705,599
root_title"体验“在Ubuntu 16上配置Python和Steem开发环境“(二)"
beneficiaries[]
max_accepted_payout1,000,000.000 HBD
percent_hbd10,000
post_id85,729,069
net_rshares0
@esteemapp ·
Thanks for using **eSteem**! <br>Your post has been voted as a part of [eSteem encouragement program](https://steemit.com/esteem/@good-karma/encouragement-program-continues-82eafcd10a299). Keep up the good work! Install [Android](https://play.google.com/store/apps/details?id=app.esteem.mobile), [iOS](https://itunes.apple.com/WebObjects/MZStore.woa/wa/viewSoftware?id=1451896376&mt=8) Mobile app or [Windows, Mac, Linux](https://github.com/esteemapp/esteem-surfer/releases) Surfer app, if you haven't already!<br>Learn more: https://esteem.app <br>Join our discord: https://discord.gg/8eHupPq
properties (22)
authoresteemapp
permlinkre-2019529t10472771z
categorysct
json_metadata{"tags":["esteem"],"app":"esteem/2.0-welcome","format":"markdown+html","community":"esteem.app"}
created2019-05-29 08:47:27
last_update2019-05-29 08:47:27
depth1
children0
last_payout2019-06-05 08:47:27
cashout_time1969-12-31 23:59:59
total_payout_value0.000 HBD
curator_payout_value0.000 HBD
pending_payout_value0.000 HBD
promoted0.000 HBD
body_length593
author_reputation420,443,679,514,793
root_title"体验“在Ubuntu 16上配置Python和Steem开发环境“(二)"
beneficiaries[]
max_accepted_payout1,000,000.000 HBD
percent_hbd10,000
post_id85,675,101
net_rshares0
@sct.kop7 ·
懂得折腾的老刘
👍  
properties (23)
authorsct.kop7
permlinkre-liuzg-ubuntu-16-python-steem-20190529t135544392z
categorysct
json_metadata{"tags":["sct"],"app":"steemcoinpan/0.1"}
created2019-05-29 13:55:45
last_update2019-05-29 13:55:45
depth1
children1
last_payout2019-06-05 13:55:45
cashout_time1969-12-31 23:59:59
total_payout_value0.000 HBD
curator_payout_value0.000 HBD
pending_payout_value0.000 HBD
promoted0.000 HBD
body_length7
author_reputation24,257,846,581
root_title"体验“在Ubuntu 16上配置Python和Steem开发环境“(二)"
beneficiaries[]
max_accepted_payout1,000,000.000 HBD
percent_hbd10,000
post_id85,689,114
net_rshares6,542,125,607
author_curate_reward""
vote details (1)
@liuzg ·
😱
properties (22)
authorliuzg
permlinkre-sctkop7-re-liuzg-ubuntu-16-python-steem-20190529t150920455z
categorysct
json_metadata{"community":"busy","app":"busy/2.5.6","format":"markdown","tags":["sct"],"users":[],"links":[],"image":[]}
created2019-05-29 15:09:24
last_update2019-05-29 15:09:24
depth2
children0
last_payout2019-06-05 15:09:24
cashout_time1969-12-31 23:59:59
total_payout_value0.000 HBD
curator_payout_value0.000 HBD
pending_payout_value0.000 HBD
promoted0.000 HBD
body_length1
author_reputation20,078,417,529,815
root_title"体验“在Ubuntu 16上配置Python和Steem开发环境“(二)"
beneficiaries[]
max_accepted_payout1,000,000.000 HBD
percent_hbd10,000
post_id85,693,122
net_rshares0
@steem-ua ·
#### Hi @liuzg!

Your post was upvoted by @steem-ua, new Steem dApp, using UserAuthority for algorithmic post curation!
Your **UA** account score is currently 2.645 which ranks you at **#14522** across all Steem accounts.
Your rank has dropped 366 places in the last three days (old rank 14156).

In our last Algorithmic Curation Round, consisting of 189 contributions, your post is ranked at **#119**.
##### Evaluation of your UA score:

* Only a few people are following you, try to convince more people with good work.
* The readers appreciate your great work!
* Try to improve on your user engagement! The more interesting interaction in the comments of your post, the better!


**Feel free to join our [@steem-ua Discord server](https://discord.gg/KpBNYGz)**
properties (22)
authorsteem-ua
permlinkre-ubuntu-16-python-steem-20190531t090633z
categorysct
json_metadata"{"app": "beem/0.20.19"}"
created2019-05-31 09:06:33
last_update2019-05-31 09:06:33
depth1
children0
last_payout2019-06-07 09:06:33
cashout_time1969-12-31 23:59:59
total_payout_value0.000 HBD
curator_payout_value0.000 HBD
pending_payout_value0.000 HBD
promoted0.000 HBD
body_length763
author_reputation23,214,230,978,060
root_title"体验“在Ubuntu 16上配置Python和Steem开发环境“(二)"
beneficiaries[]
max_accepted_payout1,000,000.000 HBD
percent_hbd10,000
post_id85,801,213
net_rshares0
@steemstem ·
re-liuzg-ubuntu-16-python-steem-20190530t204512848z
<div class='text-justify'> <div class='pull-left'> <center> <br /> <img width='200' src='https://res.cloudinary.com/drrz8xekm/image/upload/v1553698283/weenlqbrqvvczjy6dayw.jpg'> </center>  <br/> </div> 

This post has been voted on by the **SteemSTEM** curation team and voting trail. It is elligible for support from <b><a href='https://www.steemstem.io/#!/@curie'>@curie</a></b>.<br /> 

If you appreciate the work we are doing, then consider supporting our witness [**stem.witness**](https://steemconnect.com/sign/account_witness_vote?approve=1&witness=stem.witness). Additional witness support to the [**curie witness**](https://steemconnect.com/sign/account_witness_vote?approve=1&witness=curie) would be appreciated as well.<br /> 

For additional information please join us on the [**SteemSTEM discord**]( https://discord.gg/BPARaqn) and to get to know the rest of the community!<br />

Please consider setting <b><a href='https://www.steemstem.io/#!/@steemstem'>@steemstem</a></b> as a beneficiary to your post to get a stronger support.<br />

Please consider using the <b><a href='https://www.steemstem.io'>steemstem.io</a></b> app to get a stronger support.</div>
properties (22)
authorsteemstem
permlinkre-liuzg-ubuntu-16-python-steem-20190530t204512848z
categorysct
json_metadata{"app":"bloguable-bot"}
created2019-05-30 20:45:30
last_update2019-05-30 20:45:30
depth1
children0
last_payout2019-06-06 20:45:30
cashout_time1969-12-31 23:59:59
total_payout_value0.000 HBD
curator_payout_value0.000 HBD
pending_payout_value0.000 HBD
promoted0.000 HBD
body_length1,174
author_reputation262,017,435,115,313
root_title"体验“在Ubuntu 16上配置Python和Steem开发环境“(二)"
beneficiaries[]
max_accepted_payout1,000,000.000 HBD
percent_hbd10,000
post_id85,770,306
net_rshares0