tmkor avatar

윈도우 10 환경에서 steem API 라이브러리 설치하기 with python

tmkor

Published: 05 Jan 2018 › Updated: 05 Jan 2018윈도우 10 환경에서 steem API 라이브러리 설치하기 with python

윈도우 10 환경에서 steem API 라이브러리 설치하기 with python

20180105 python title.png

안녕하세요 tmkorHive account@tmkor 입니다.

오늘은 python에서 steem API를 사용할 수 있도록 하는 steem-python을 설치해보려고 합니다.

'응? 단순한 설치 글인데 무슨 거창한 포스팅이냐?' 하시는 분들은.. 세상사라는게 단순한 일일 수록 힘들때가 있음을 이해해주시기 바랍니다. ㅠㅠ

  • 본 문서는 python3 버전을 기준으로 작성되었습니다.

준비물

  • Python 3.5
    • 주의 : 3.6은 안됩니다. 'ㅅ') 뭔 방법을 써도 설치가 안되었습니다.
  • Visual Studio 2015용 Build Tools
    • 2017용도 괜찮습니다. 이 경우 setuptools 버전이 34.4.0 이상이어야 합니다.
  • 메모장

설치방법

  1. Python 3.5.x를 설치합니다. (TIP : PATH 등록 체크박스에 체크합시다.)
  2. Visual Studio 2015용 Build Tools를 설치합니다.
  3. Visual C++ 2015 x64 x86 cross Build Tools Command Prompt를 실행합니다.
    • 2018-01-05-18-23-06.png
  4. pip install -U steem
    • 여기까지 문제가 없다면 거의 다 된 것입니다!
    • 그렇지만 import를 시키면 에러가 뿜뿜 나옵니다. 'ㅅ')
    • winrandom 모듈 import에서 에러가 나는 것인데.. 이를 fix 해봅시다.
  5. python -m site 를 입력해서 site-package 경로를 알아냅니다.
    • 2018-01-05-18-25-38.png
  6. %site-package%\Crypto\Random\OSRNG 폴더로 이동합시다.
  7. nt.py 파일을 엽니다.
  8. import winrandomfrom . import winrandom으로 바꿔줍시다.
    • 2018-01-05-18-26-43.png

테스트 코드

  • 정상 작동하는지 테스트 코드를 돌려봅시다. 아래 코드는 특정 id의 블로그의 최신글을 가져오는 것 입니다.
#%% run with jupyter
from steem.post import Post
from steem.blog import Blog
import pprint
#%% import steem module
b = Blog('tmkor') # get a blog
p = next(b) # get a post
pj = p.export() # download a post
pprint.pprint(pj) #print a post
  • 결과확인

2018-01-05-19-23-05.png


모두 즐거운 개발 되시길 바랍니다. :D

Leave 윈도우 10 환경에서 steem API 라이브러리 설치하기 with python to:

Written by

Read more #kr-dev posts


Best Posts From tmkor

We have not curated any of tmkor's posts yet. But you can encourage our curation team to review posts by visiting them regularly and by referring other readers. Because we give priority to frequently read content.

More Posts From tmkor