sebastianst / GenesisZ

Mine the Genesis Block for your Zcashy altcoin
Other
25 stars 27 forks source link

ImportError: No module named 'bitcoin' #1

Closed asciitohex closed 7 years ago

asciitohex commented 7 years ago

hello, what's wrong? ( ubuntu 16-04 LTS 64 )

./genesis.py -s "/root/silentarmy/sa-solver --nonces 4000 -i" -t 1477641360 Traceback (most recent call last): File "./genesis.py", line 18, in from bitcoin.core import * ImportError: No module named 'bitcoin'

This is my procedure

 root@ubuntu:~# git clone --recursive https://github.com/sebastianst/GenesisZ
Cloning into 'GenesisZ'...
remote: Counting objects: 222, done.
remote: Total 222 (delta 0), reused 0 (delta 0), pack-reused 222
Ricezione degli oggetti: 100% (222/222), 46.02 KiB | 0 bytes/s, done.
Risoluzione dei delta: 100% (116/116), done.
Checking connectivity... fatto.
Submodule 'zcash' (https://github.com/sebastianst/python-zcashlib.git) registered for path 'zcash'
Cloning into '/root/GenesisZ/zcash'...
Submodule path 'zcash': checked out 'c20e6edefd5d3a57daf00340659cc07487629638'
root@ubuntu:~# virtualenv GenesisZ
Running virtualenv with interpreter /usr/bin/python2
New python executable in /root/GenesisZ/bin/python2
Also creating executable in /root/GenesisZ/bin/python
Installing setuptools, pkg_resources, pip, wheel...done.
root@ubuntu:~# cd GenesisZ
root@ubuntu:~/GenesisZ# source bin/activate
(GenesisZ) root@ubuntu:~/GenesisZ# pip install -r requirements.txt
Collecting python-bitcoinlib (from -r requirements.txt (line 1))
  Using cached python_bitcoinlib-0.7.0-py2.py3-none-any.whl
Collecting pyblake2 (from -r requirements.txt (line 2))
Collecting requests (from -r requirements.txt (line 3))
  Using cached requests-2.18.3-py2.py3-none-any.whl
Collecting chardet<3.1.0,>=3.0.2 (from requests->-r requirements.txt (line 3))
  Using cached chardet-3.0.4-py2.py3-none-any.whl
Collecting certifi>=2017.4.17 (from requests->-r requirements.txt (line 3))
  Using cached certifi-2017.7.27.1-py2.py3-none-any.whl
Collecting idna<2.6,>=2.5 (from requests->-r requirements.txt (line 3))
  Using cached idna-2.5-py2.py3-none-any.whl
Collecting urllib3<1.23,>=1.21.1 (from requests->-r requirements.txt (line 3))
  Using cached urllib3-1.22-py2.py3-none-any.whl
Installing collected packages: python-bitcoinlib, pyblake2, chardet, certifi, idna, urllib3, requests
Successfully installed certifi-2017.7.27.1 chardet-3.0.4 idna-2.5 pyblake2-0.9.3 python-bitcoinlib-0.7.0 requests-2.18.3 urllib3-1.22
(GenesisZ) root@ubuntu:~/GenesisZ# git pull && git submodule update
Fetching submodule zcash
Already up-to-date.
(GenesisZ) root@ubuntu:~/GenesisZ# ./genesis.py -s "/root/silentarmy/sa-solver --nonces 4000 -i" -t 1477641360
Traceback (most recent call last):
  File "./genesis.py", line 18, in <module>
    from bitcoin.core import *
ImportError: No module named 'bitcoin'
(GenesisZ) root@ubuntu:~/GenesisZ#

Thank you for you support

sebastianst commented 7 years ago

You need to use python3. I use Arch Linux, where python defaults to v3.6.2. Repeat the steps from getting started with the python3 equivalents and report if it works then. I'll add python3 as an explicit requirement to the readme then. Thanks!

asciitohex commented 7 years ago

i set python3 as default virtualenv and it works now Thank you

install python 3.6 as default python version on ubuntu 16.04

sudo add-apt-repository ppa:jonathonf/python-3.6 sudo apt-get update sudo apt-get install python3.6 sudo update-alternatives --install /usr/bin/python3 python3 /usr/bin/python3.5 1 sudo update-alternatives --install /usr/bin/python3 python3 /usr/bin/python3.6 2 sudo update-alternatives --config python3 sudo rm /usr/bin/python3 sudo ln -s python3.5 /usr/bin/python3

then install python3-pip and change virtualenv

sudo apt install python3-pip virtualenv --python=/usr/bin/python3 GenesisZ