Steem-python installation on Linux

in #computer6 years ago (edited)

After the failed attempt in installing steem-python in Windows. I decided not to waste more time on solving the problems and move on to a Ubuntu virtual machine which is practically a more friendly environment for such work.

Install VM and set up Python environment via Anaconda

Anaconda is the recommended python environment by the official document. After installing Ubuntu in Virutalbox which is quite straight-forward, I proceeded with the git clone method instead of the pip as the former would be getting the source code from official github repository.

sudo apt install git
git clone https://github.com/steemit/steem-python
cd steem-python
sudo make install

Errors in the installation

Here are the common errors the installation will hit under Linux environment and already being reported by many users.

scrypt-1.2.1/libcperciva/crypto/crypto_aes.c:6:10: fatal error: openssl/aes.h: No such file or directory
#include <openssl/aes.h>
          ^~~~~~~~~~~~~~~
compilation terminated.
error: Setup script exited with error: command 'x86_64-linux-gnu-gcc' failed with exit status 1
Makefile:18: recipe for target 'install' failed
make: *** [install] Error 1

Traceback (most recent call last):
  File "/usr/local/bin/steempy", line 6, in <module>
    from pkg_resources import load_entry_point
  File "/usr/lib/python2.7/dist-packages/pkg_resources/__init__.py", line 3088, in <module>
    @_call_aside
  File "/usr/lib/python2.7/dist-packages/pkg_resources/__init__.py", line 3072, in _call_aside
    f(*args, **kwargs)
  File "/usr/lib/python2.7/dist-packages/pkg_resources/__init__.py", line 3101, in _initialize_master_working_set
    working_set = WorkingSet._build_master()
  File "/usr/lib/python2.7/dist-packages/pkg_resources/__init__.py", line 574, in _build_master
    ws.require(__requires__)
  File "/usr/lib/python2.7/dist-packages/pkg_resources/__init__.py", line 892, in require
    needed = self.resolve(parse_requirements(requirements))
  File "/usr/lib/python2.7/dist-packages/pkg_resources/__init__.py", line 778, in resolve
    raise DistributionNotFound(req, requirers)
pkg_resources.DistributionNotFound: The 'scrypt>=0.8.0' distribution was not found and is required by steem

This is mainly due to the Ubuntu system was not able to find the scrypt package which can be easily fixed by

sudo apt-get install libssl-dev

Or as suggested by the official doc

brew install openssl
export CFLAGS="-I$(brew --prefix openssl)/include $CFLAGS"
export LDFLAGS="-L$(brew --prefix openssl)/lib $LDFLAGS"

Test and done

Use python to enter pyton prompt mode and test with the simple get_account function and it works.

VirtualBox_2018-09-30_09-07-20.png

Test with steempy which is a practical CLI utility for Steem and it should be working without errors too.

VirtualBox_2018-09-30_09-11-11.png


Posted from my blog with SteemPress : https://fr3eze.vornix.blog/steem-python-installation-on-linux/

Sort:  

I was also having issues with steem-python on Windows due to some stupid cryptography library error :3 on Linux it's a one-shot success installation. Now I guess why we have so many cool tools on Linux while most commercial stuff tend to stay on Windows haha.

Because windows is all about average user friendly but it is not designed for development job. Luckily it is easy to set up Linux environment in Windows thru various ways tho.

Posted using Partiko Android

Have you tried beempy? Seems to be a better option compared to steempy. I was also using steempy all along and recently got to know about beempy

Posted using Partiko Android

Oh I kind of heard of that long time ago but had no idea what it was until now. Installed the CLI tool to know better about the Steem lower layer but I sure will check that Beempy out since the Steempy is not as well-designed as I thought.

Posted using Partiko Android

Beempy has more functions as compared to steempy. At least that's what I found. Haha..

Posted using Partiko Android

Hi @fr3eze!

Your post was upvoted by @steem-ua, new Steem dApp, using UserAuthority for algorithmic post curation!
Your UA account score is currently 3.964 which ranks you at #3622 across all Steem accounts.
Your rank has not changed in the last three days.

In our last Algorithmic Curation Round, consisting of 369 contributions, your post is ranked at #206.

Evaluation of your UA score:
  • You're on the right track, try to gather more followers.
  • The readers like your work!
  • Try to work on user engagement: the more people that interact with you via the comments, the higher your UA score!

Feel free to join our @steem-ua Discord server

Coin Marketplace

STEEM 0.20
TRX 0.13
JST 0.030
BTC 65017.48
ETH 3454.80
USDT 1.00
SBD 2.50