Finally got steem-python to work with PyCharm

in steem •  7 years ago 

I'm a little ashamed to say this but it took way longer than i expected to get steem-python up and running on my preferred IDE - PyCharm. According to the docs, all it takes is a simple:

pip install -U steem 

Unfortunately, that threw up a ton of errors, most of which seemed fairly straightforward. The bulk of the errors were related to having to update my Microsoft Visual C++ Build Tools as well as Python's setuptools.

"c:\users\user\appdata\local\programs\python\python36\python.exe -u
-c "import setuptools, tokenize;__file__='C:\\Users\\***AN~1\\AppData\\Local    \\
Temp\\pip-build-9e4h7q1o\\pycrypto\\setup.py';f=getattr(tokenize, 'open',     open)(
__file__);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code,     __fil
e__, 'exec'))" install --record C:\Users\***AN~1\AppData\Local\Temp\pip-    gfrm999
1-record\install-record.txt --single-version-externally-managed --compile"     faile
d with error code 1 in C:\Users\***AN~1\AppData\Local\Temp\pip-build-    9e4h7q1o\p
ycrypto\

Anyway, that didn't work and i was still stuck with the errors. After more than 4 hours of mucking around, i was nowhere closer to getting it fixed.

Here's what worked

The bit of breakthrough came when i came across this StackOverflow post about someone having the same problem.

In the post, David Cullen highlights that the recommended way to install steem is using Anaconda. I saw that written in the official docs but i didn't think it would make that big of a difference. Anyway, long story short, it worked. The last step was to get PyCharm to use the Anaconda's Python Interpreter instead and we're all set.

Step-by-Step

1. Update setuptools

python -m pip install -U pip

2. Make sure you have Microsoft visual C++ 14.0 installed

You can grab the necessary installer from here: http://landinghub.visualstudio.com/visual-cpp-build-tools

3. Install steem using the Anaconda prompt

Start the Anaconda prompt and install steem using the command:

pip install -U steem 

Now, you have the steem package installed, but you still won't be able to use it just yet.

4. Change the Interpreter used to Anaconda's

pythoncharm.JPG

Go to File -> Settings->Project->Project Intepreter and select Anaconda's version of Python.exe like in the picture above. Once done, you can now use the steem package from PyCharm. Hope it helps!

:)

Authors get paid when people like you upvote their post.
If you enjoyed what you read here, create your account today and start earning FREE STEEM!
Sort Order:  
  ·  7 years ago (edited)

You could also do and start on step 3:

conda config --add channels conda-forge
conda install steem