Skip to content

Instantly share code, notes, and snippets.

@SerpentChris
Created December 30, 2016 22:30
Show Gist options
  • Save SerpentChris/e97336a28d29bc03fc39562511b14b82 to your computer and use it in GitHub Desktop.
Save SerpentChris/e97336a28d29bc03fc39562511b14b82 to your computer and use it in GitHub Desktop.
Installing pyethereum on macOS Sierra
Installing pyethereum on macOS Sierra took a few steps, which were not obvious.
First, you need to install the Xcode command line tools. To do this, open a terminal and type:
xcode-select --install
Next, you need to install Homebrew. You can find out how to do that by going to the website http://brew.sh .
Once you have Homebrew, you need to install python. I prefer python 3:
brew install python3
Once that's finished, you need to upgrade pip:
pip3 install --upgrade pip
I like to use a virtualenv to test my messy projects without installing them to my system.
pip3 install virtualenv
mkdir workspace && virtualenv workspace
cd workspace && source bin/activate
Note: In my .bashrc, I use a couple of scripts to automatically `source bin/activate` whenever I cd into a virtualenv, and `deactivate` whenever I cd out of one. It might be worth a look: https://git.io/vMLd7
Next, you need to install a few more dependencies using Homebrew:
brew install pkg-config autoconf automake libyaml
Then, you need to install the python scrypt module, which requires some special compile flags in order to use the Homebrew openssl library (which should have been install when you install python from Homebrew):
env LDFLAGS="-L$(brew --prefix openssl)/lib" CFLAGS="-I$(brew --prefix openssl)/include" pip install scrypt
Almost done, now you need to clone pyethereum from github. I use my own fork, which is forked from a pyethereum fork that has a few fixes added to make it work with python3:
git clone https://github.com/CryptoChris7/pyethereum.git
Now you should be able to install pyethereum:
cd pyethereum && python setup.py install
Happy Hacking!
@tina1998612
Copy link

I used python REPL in the terminal but received the err No module named 'ethereum.tools' when running from ethereum.tools import tester as t
I followed all steps above >< Any help would be much appreciated. Thanks!!

@mgbvox
Copy link

mgbvox commented May 3, 2018

While following the above protocol, I kept getting that py_evm-0.2.0a16 requires pyethash-0.1.27, while I only have pyethash-0.1.23 (when I try to uninstall or upgrade with pip I get an error saying I can't uninstall because they can't determine what's using it... or whatever. Frankly all of this is insanely confusing.) Help.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment