No module named 'cert_issuer'


#1

I’m trying to issue some test certificates and when I try to run the cert_issuer I get this error:

python3 cert-issuer/cert_issuer/ -c conf.ini
Traceback (most recent call last):
File “/usr/lib/python3.5/runpy.py”, line 184, in _run_module_as_main
"main", mod_spec)
File “/usr/lib/python3.5/runpy.py”, line 85, in _run_code
exec(code, run_globals)
File “cert-issuer/cert_issuer/main.py”, line 21, in
cert_issuer_main()
File “cert-issuer/cert_issuer/main.py”, line 14, in cert_issuer_main
from cert_issuer import config
ImportError: No module named ‘cert_issuer’

Am I just totally missing something?


Installing Cert-issuer
#2

(Putting this together from another thread) I think you mentioned you were not running in docker, which installs cert-issuer. as well as other setup. Either way, this will work if you’ve pip-installed cert-issuer


#3

Hi Kim,

I am getting cert-issuer error, even I am running it in docker.
see below error

bash-4.3# cert-issuer -c /etc/cert-issuer/conf.ini
Traceback (most recent call last):
File “/usr/bin/cert-issuer”, line 11, in
load_entry_point(‘cert-issuer==2.0.9’, ‘console_scripts’, ‘cert-issuer’)()
File “/usr/lib/python3.5/site-packages/cert_issuer/main.py”, line 14, in cert_issuer_main
from cert_issuer import config
File “/usr/lib/python3.5/site-packages/cert_issuer/config.py”, line 6, in
from cert_schema import BlockchainType, Chain, chain_to_bitcoin_network, UnknownChainError
ImportError: cannot import name 'BlockchainType’
bash-4.3#


#4

(Duplicate post?)

Hi,
Can you try running this script, to clear out old docker images and containers?

#!/bin/bash

docker rm -v $(docker ps -a -q -f status=exited)

docker run -v /var/run/docker.sock:/var/run/docker.sock -v /var/lib/docker:/var/lib/docker --rm martin/docker-cleanup-volumes

Thanks,
Kim


#5

I tried with docker on linux VM and it worked, however when I am trying to use to from my windows machine without docker I am getting similar issue

D:\Work\BlockChain\blockchain-certificates\cert-issuer>python cert_issuer -c con
f_regtest.ini
Traceback (most recent call last):
File “D:\Python27\Lib\runpy.py”, line 174, in run_module_as_main
"main", fname, loader, pkg_name)
File “D:\Python27\Lib\runpy.py”, line 72, in run_code
exec code in run_globals
File "D:\Work\BlockChain\blockchain-certificates\cert-issuer\cert_issuer_mai
n
.py", line 21, in
cert_issuer_main()
File "D:\Work\BlockChain\blockchain-certificates\cert-issuer\cert_issuer_mai
n
.py", line 14, in cert_issuer_main
from cert_issuer import config
File “D:\Work\BlockChain\blockchain-certificates\cert-issuer\cert_issuer\confi
g.py”, line 6, in
from cert_schema import Chain
ImportError: cannot import name Chain

D:\Work\BlockChain\blockchain-certificates\cert-issuer>


#6

I cleaned out my python package state and docker images and was able to repro. Essentially, I tracked this back to: https://github.com/blockchain-certificates/cert-issuer/issues/71

I pinged the authors of pyld for an ETA on a fix; either way I’ll try to get a fix (clean or dirty) out today


#7

Ok, we’re in business! The pyld issue was fixed, so I consumed that, republished packages, and ensured the blockcerts stack works (completely clean environment).

Closed tracking issue: https://github.com/blockchain-certificates/cert-issuer/issues/71


#8

Dear Kim,

Thanks for your help and the earlier issue is not appearing now.

However I am getting below error

D:\Work\BlockChain\blockchain-certificates\cert-issuer>python cert_issuer -c con
f_regtest.ini
WARNING - Your app is configured to skip the wifi check when the USB is plugged
in. Read the documentation to ensure this is what you want, since this is less s
ecure
INFO - This run will try to issue on the bitcoin_regtest chain
Traceback (most recent call last):
File “D:\Python27\Lib\runpy.py”, line 174, in run_module_as_main
"main", fname, loader, pkg_name)
File “D:\Python27\Lib\runpy.py”, line 72, in run_code
exec code in run_globals
File "D:\Work\BlockChain\blockchain-certificates\cert-issuer\cert_issuer_mai
n
.py", line 21, in
cert_issuer_main()
File "D:\Work\BlockChain\blockchain-certificates\cert-issuer\cert_issuer_mai
n
.py", line 16, in cert_issuer_main
from cert_issuer import issue_certificates
File “D:\Work\BlockChain\blockchain-certificates\cert-issuer\cert_issuer\issue
_certificates.py”, line 6, in
from cert_issuer import signer as signer_helper
File “D:\Work\BlockChain\blockchain-certificates\cert-issuer\cert_issuer\signe
r.py”, line 19, in
from ethereum import transactions
ImportError: No module named ethereum

I am trying to run it for bitcoin regtest do I still need to install ethereum client or any dependency?

Thanks and Regards,
Danish


#9

Hi Danish,
Can you try using virtualenv on Windows, instead of the system python? Also, it looks like you are using python 2.7, but this needs python3+.

With virtualenv using python 3+, the dependency installs should work.

Some instructions are here, but to enable python3, use

virtualenv -p python3 venv

instead of the following in step 2:

virtualenv venv

Thanks,
Kim


#10

Dear Kim,

Do I need to use any specific python version? with 3.6.3 I am getting below error

c:\work\BlockChain\blockchain-certificates\cert-issuer>pip install .
Processing c:\work\blockchain\blockchain-certificates\cert-issuer
Complete output from command python setup.py egg_info:
Traceback (most recent call last):
File “”, line 1, in
File “C:\Users\admin\AppData\Local\Temp\pip-8wcfxpet-build\setup.py”, line 14, in
long_description = fp.read()
File “c:\python36\lib\encodings\cp1252.py”, line 23, in decode
return codecs.charmap_decode(input,self.errors,decoding_table)[0]
UnicodeDecodeError: ‘charmap’ codec can’t decode byte 0x9d in position 6475: character maps to

----------------------------------------

Command “python setup.py egg_info” failed with error code 1 in C:\Users\admin\AppData\Local\Temp\pip-8wcfxpet-build\


#11

Hi @d.hussain,

That looks like an encoding error; is there any way to ensure you are using UTF-8? I haven’t deployed this on a windows machine, but I believe others in the community have. If anyone has tips for deploying on Windows, I’d appreciate it.

Thanks,
Kim


#12

Dear @kim,

I would love to run it on windows so any help from community will be much appreciated.

Just to keep thing rolling I tried it on linux without docker with python 3 and getting error" ImportError: No module named ‘bitcoin.rpc’ " below are details.

(py3env) root@ubuntu:/u01/blockchain-certificates/cert-issuer# python3 cert_issuer -c conf_testnet.ini
Traceback (most recent call last):
File “/usr/lib/python3.5/runpy.py”, line 184, in _run_module_as_main
"main", mod_spec)
File “/usr/lib/python3.5/runpy.py”, line 85, in _run_code
exec(code, run_globals)
File “cert_issuer/main.py”, line 21, in
cert_issuer_main()
File “cert_issuer/main.py”, line 14, in cert_issuer_main
from cert_issuer import config
File “/u01/blockchain-certificates/cert-issuer/py3env/lib/python3.5/site-packages/cert_issuer/config.py”, line 4, in
import bitcoin
File “cert_issuer/bitcoin/init.py”, line 7, in
from cert_issuer.bitcoin.connectors import BitcoinServiceProviderConnector
File “/u01/blockchain-certificates/cert-issuer/py3env/lib/python3.5/site-packages/cert_issuer/bitcoin/init.py”, line 7, in
from cert_issuer.bitcoin.connectors import BitcoinServiceProviderConnector
File “/u01/blockchain-certificates/cert-issuer/py3env/lib/python3.5/site-packages/cert_issuer/bitcoin/connectors.py”, line 9, in
import bitcoin.rpc
ImportError: No module named ‘bitcoin.rpc’
(py3env) root@ubuntu:/u01/blockchain-certificates/cert-issuer#

Regards,
Danish


#13

I noticed when i run
python setup.py install
I received below error
error: pysha3 1.0.2 is installed but pysha3==1.0b1 is required by {‘merkletools’}


#14

Strange as it sounds, the error for me relied in the file “README.ME” under cert-issuer-master. There are some characters there that are not reencoded correctly. If you chage ir manually in the file (notepad, or even better wordpad), it will go flawessly. Look for strange characters like “€” and so. For example, go to the section:

What should be in a batch?

How a batch is defined can vary, but it should be defined such that it changes infrequently. For example, “2016 MIT grads” would be preferred over “MIT grads” (the latter…

when it should be:

What should be in a batch?

How a batch is defined can vary, but it should be defined such that it changes infrequently. For example, “2016 MIT grads” would be preferred over “MIT grads” (the latter…

There are some more. You may change everyone, or just delete from there on, and save the file. It worked for me.

Regards,

Enrique


#15

(sorry for the typo: README.MD instead of README.ME)


#16

And again sorry. The previous answer where for


#17

I solved this way in *WINDOWS". I don’t know whether it is the best way or not, but that’s how I went over it:

Good to know, the issue is about two conflicting libraries in the project. Merkletools requires “exactly” pysha3 1.01b, while cert-tools require pysha3 1.0.2 or greater
I used “pip install cert-issuer” instead “python setup.py install”
I tried the force-brute approach: I went to C:\Users"user"\AppData\Local\Programs\Python\Python36\Lib\site-packages\merkletools-1.0.2-py3.6.egg\EGG-INFO, and open “requires.txt” with a text editor (wordpad will do). Change the contents inside to pysha3==1.0.2 (maybe >= would be better)
That’s all. Sure, there should be better ways to solve the problem…


#18

@enriquelizaso Thanks for your help…
This works much appreciated. With this I managed to run issuer without docker :smiley


Problem with running cert-issuer
#19

Could you help me explain the steps you used.
I’m trying to run issuer without docker but am encountering a lot of errors, especially no module named ‘bitcoin.rpc’.

Thanks.