MacOS Steem Python Atom Setup
I got myself a new Macbook the other day and decided to make this tutorial for setting up a local Python environment, installing and setting up the Atom text editor and getting steem-python working. (of course :) )
There are no strict requirements for MacOS, so you can easily adapt this for Windows or Linux.
![](https://steemitimages.com/600x0/https://steemitimages.com/DQmUCHi4at3ZzoFUnaQ5AWKfdaFhU1viqXPz1LfzRS7DgBG/image.png)
Anaconda
Download and install Anaconda:
https://www.anaconda.com/download/#macos
Instead of using whatever version of Python that comes with your operating system, I would recommend you to use Anaconda instead.
To save space you might also opt for miniconda, which is a much smaller alternative without any additional packages. Have a look here: https://conda.io/miniconda.html
Install a Virtual Environment
Before doing anything with Python, let's create a virtual environment. That way we will have an isolated python environment for our testing, without worrying about adding unneccessary modules to our base environment. If something goes wrong, just delete the environment and start over with a new one. Create a virtual environment with:
conda create --name testenv
(replace create with remove to delete it.)
Merlin:~ daniel$ conda create --name testenv
Solving environment: done
## Package Plan ##
environment location: /anaconda3/envs/testenv
Proceed ([y]/n)?
Preparing transaction: done
Verifying transaction: done
Executing transaction: done
#
# To activate this environment, use:
# > source activate testenv
#
# To deactivate an active environment, use:
# > source deactivate
#
Check your available environments with:
conda info -e
Install Steem-Python
Before installing steem-python make sure you are in your virtual environment.
Merlin:~ daniel$
source activate testenv
Install pip in your virtual environment and then install steem-python.
(testenv) Merlin:~ daniel$
conda install pip
You need pipenv just to be able to read the requirements file.
(testenv) Merlin:~ daniel$
pip install pipenv
(testenv) Merlin:~ daniel$
git clone https://github.com/steemit/steem-python.git
(testenv) Merlin:~ daniel$
cd steem-python
(testenv) Merlin:steem-python daniel$
pip install .
Steem-python DONE!!
Download & Install Atom
Head over to https://atom.io/. Download and install it on your machine.
Atom Python
![Atom](https://steemitimages.com/600x0/https://i.imgur.com/zxLhFzc.png)
After starting Atom you will be greeted with a Welcome Guide tab. Click on Install a Package
and click Open Installer
.
![welcome guide](https://steemitimages.com/600x0/https://i.imgur.com/bG2rh5i.png)
Search for the two packages below and install them. When installing the Python Autocomplete Package, choose the Jedi, local engine.
Install PlatformIO IDE Terminal
Python Autocomplete Package
You might have to restart Atom for everything to load properly.
Let's get started with Python using Atom
Click + sign in bottom left corner to open up a terminal window.
![terminal](https://steemitimages.com/600x0/https://i.imgur.com/26yZSwL.png)
Run: source activate testenv
to activate your virtual environment.
Test with some commands in Atom's terminal windwon as shown below:
![testing steem-python](https://steemitimages.com/600x0/https://i.imgur.com/Zhln4RG.png)
Ctrl+D to exit
Let's use Atom to create a python script
- Create a new file. Click File->New File.
- Save it with .py extension in your AnacondaProject folder, or which ever folder you prefer.
- Click Add Project Folder from the file menu and add the folder in the step above.
You should see something like in the screenshot below. Make sure your terminal window is in the correct folder and you can see your .py file:
![atom saved file](https://steemitimages.com/600x0/https://i.imgur.com/kCr7w8q.png)
Add some simple code and execute it via the terminal window.
![steem-python test](https://steemitimages.com/600x0/https://i.imgur.com/u8QjbLi.png)
Extend the code to check out the autocomplete and help functionality. Use Tab to get an indent of 4 spaces. If you never worked with Atom before it looks like it is a tab, but it will be saved as a 4 space indent.
![Atom Help and auto complete](https://steemitimages.com/600x0/https://i.imgur.com/KI2slpb.png)
![steem-python test2](https://steemitimages.com/600x0/https://i.imgur.com/CoDfXsX.png)
I'm just loving it!! :)
It is a breeze to work with Atom and I really like the autocomplete functionality.
In an upcoming post I will show you how I'm using Atom as well as a markdown editor. A SteemDev tool and a Steemit post creator, all-in-one. That's pretty cool! ;)
Thank you for your time and please let me know if you have any questions
@abdulmanan Could you please clarify why Anaconda?
Downvoting a post can decrease pending rewards and make it less visible. Common reasons:
Submit
It is Conda I'm after, be it either Anaconda or miniconda. It just simplifies the setup and makes it more standardized among different distributions.
Downvoting a post can decrease pending rewards and make it less visible. Common reasons:
Submit
In my opinion, better to use clean python, because with anaconda you will get a bunch of packages that no needed in the described case. But anyway this post is very useful. Good job :)
Downvoting a post can decrease pending rewards and make it less visible. Common reasons:
Submit
If you by clean mean compiling it, I would agree. But I would avoid the version that comes with the OS, with Ubuntu for example. For conda, I prefer myself miniconda as there are no unnecessary packages. For this guide the key was simplicity, and I think getting Anaconda/Miniconda running was the easiest option to describe a standardize a way to get python going.
Downvoting a post can decrease pending rewards and make it less visible. Common reasons:
Submit
Check youre wallet @danielsaori...
Thanks and i'm sorry...
Downvoting a post can decrease pending rewards and make it less visible. Common reasons:
Submit
Thank Buil! That is the right spirit. It was my fault to do the transfer so I appreciate your honesty. Expect some nice upvotes, which will more than enough cover the err-transfer. Cheers Buil!
Downvoting a post can decrease pending rewards and make it less visible. Common reasons:
Submit
@dorabot ?winner test
Downvoting a post can decrease pending rewards and make it less visible. Common reasons:
Submit
No Winner!! No upvotes on this post... :(
Downvoting a post can decrease pending rewards and make it less visible. Common reasons:
Submit
@dorabot ?winner test
Downvoting a post can decrease pending rewards and make it less visible. Common reasons:
Submit
No Winner!! No upvotes on this post... :(
Downvoting a post can decrease pending rewards and make it less visible. Common reasons:
Submit
I recommend using furion’s version of steem-python as it resolves some bugs and is updated more frequently.
Downvoting a post can decrease pending rewards and make it less visible. Common reasons:
Submit
Thx, I have looked at both furion's and emre's fork, but I've been running with my own fork so I've held back trying something else. Also happy to see the official steem-python seems to be getting more attention, hopefully that will remain.
Downvoting a post can decrease pending rewards and make it less visible. Common reasons:
Submit
What you change in yours? Furion fixes some bugs in his. Didn’t know Emre made changes as well.
@furion was the one who originally made it.
Downvoting a post can decrease pending rewards and make it less visible. Common reasons:
Submit
One change was linked to a loop to infinity in case of an erronous rpc node. But I saw some PRs linked to that so it might already be fixed.
Other than that, only some changes in steembase to adjust timeout values. Had to do that to get it to run well with Discord.py.
Downvoting a post can decrease pending rewards and make it less visible. Common reasons:
Submit
Very good amigo
Downvoting a post can decrease pending rewards and make it less visible. Common reasons:
Submit
useful information.
Downvoting a post can decrease pending rewards and make it less visible. Common reasons:
Submit
Thx! ;)
Downvoting a post can decrease pending rewards and make it less visible. Common reasons:
Submit
You haven't discussed my matter with #pal :(
Downvoting a post can decrease pending rewards and make it less visible. Common reasons:
Submit
This post has received gratitude of 8.78 % from @appreciator thanks to: @danielsaori.
Downvoting a post can decrease pending rewards and make it less visible. Common reasons:
Submit