VOLTTRON / openeis

Other
10 stars 15 forks source link

python3 bootstrap.py step error #43

Open tomiscat opened 6 years ago

tomiscat commented 6 years ago

I want to build Analytics Historian (OpenEIS) for Volttron. Following the second documentation in the step of python3 bootstrap.py: http://volttron.readthedocs.io/en/4.1/core_services/historians/Analyitics-Historian.html#analytics-historian

and the OpenEIS user guide: https://github.com/VOLTTRON/openeis/raw/2.x/guides/PNNL-24065%20-%20OpenEIS%20Users%20Guide.pdf

I am getting the below error:

Traceback (most recent call last):
  File "bootstrap.py", line 223, in <module>
    main()
  File "bootstrap.py", line 219, in main
    stage1()
  File "bootstrap.py", line 183, in stage1
    builder.create(directory)
  File "/home/USER-NAME/anaconda3/lib/python3.6/venv/__init__.py", line 69, in create
    self.setup_scripts(context)
  File "/home/USER-NAME/anaconda3/lib/python3.6/venv/__init__.py", line 260, in setup_scripts
    self.install_scripts(context, path)
  File "/home/USER-NAME/anaconda3/lib/python3.6/venv/__init__.py", line 326, in install_scripts
    data = self.replace_variables(data, context)
  File "/home/USER-NAME/anaconda3/lib/python3.6/venv/__init__.py", line 285, in replace_variables
    text = text.replace('__VENV_PROMPT__', context.prompt)
TypeError: replace() argument 2 must be str, not None

I am running the command from the below directory after activating volttron and creating the directory and adding the (openeis-master.zip) content inside this path: (volttron)USER-NAME@USER-NAME:~/openeis-1.x$ python3 bootstrap.py

My operating system is Ubuntu :16.04 LTS

zchox commented 6 years ago

Python version >=3.3 and <=3.4.3 is required because in it was introduced the venv package (for creating virtual environments), implicit namespace packaging, and improved import machinery which are all used by OpenEIS.

sichen1234 commented 5 years ago

I tried it just now and had the same problem. I got python3.4 following directions from https://askubuntu.com/questions/802279/how-to-install-python-3-4-5-from-apt. Then using python3.4 I still got more errors:

$ python3.4 bootstrap.py 
Downloading get-pip.py
Traceback (most recent call last):
  File "bootstrap.py", line 190, in stage2
    import pip
ImportError: No module named 'pip'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "bootstrap.py", line 193, in stage2
    import ensurepip
ImportError: No module named 'ensurepip'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/lib/python3.4/urllib/request.py", line 1183, in do_open
    h.request(req.get_method(), req.selector, req.data, headers)
  File "/usr/lib/python3.4/http/client.py", line 1137, in request
    self._send_request(method, url, body, headers)
  File "/usr/lib/python3.4/http/client.py", line 1182, in _send_request
    self.endheaders(body)
  File "/usr/lib/python3.4/http/client.py", line 1133, in endheaders
    self._send_output(message_body)
  File "/usr/lib/python3.4/http/client.py", line 963, in _send_output
    self.send(msg)
  File "/usr/lib/python3.4/http/client.py", line 898, in send
    self.connect()
  File "/usr/lib/python3.4/http/client.py", line 1287, in connect
    server_hostname=server_hostname)
  File "/usr/lib/python3.4/ssl.py", line 368, in wrap_socket
    _context=self)
  File "/usr/lib/python3.4/ssl.py", line 586, in __init__
    self.do_handshake()
  File "/usr/lib/python3.4/ssl.py", line 813, in do_handshake
    self._sslobj.do_handshake()
ssl.SSLError: [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed (_ssl.c:600)

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "bootstrap.py", line 223, in <module>
    main()
  File "bootstrap.py", line 217, in main
    stage2(upgrade=upgrade)
  File "bootstrap.py", line 196, in stage2
    get_pip()
  File "bootstrap.py", line 139, in get_pip
    response = urlopen(pip_url, cafile=cafile)
  File "/usr/lib/python3.4/urllib/request.py", line 161, in urlopen
    return opener.open(url, data, timeout)
  File "/usr/lib/python3.4/urllib/request.py", line 464, in open
    response = self._open(req, data)
  File "/usr/lib/python3.4/urllib/request.py", line 482, in _open
    '_open', req)
  File "/usr/lib/python3.4/urllib/request.py", line 442, in _call_chain
    result = func(*args)
  File "/usr/lib/python3.4/urllib/request.py", line 1226, in https_open
    context=self._context, check_hostname=self._check_hostname)
  File "/usr/lib/python3.4/urllib/request.py", line 1185, in do_open
    raise URLError(err)
urllib.error.URLError: <urlopen error [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed (_ssl.c:600)>
Traceback (most recent call last):
  File "bootstrap.py", line 223, in <module>
    main()
  File "bootstrap.py", line 219, in main
    stage1()
  File "bootstrap.py", line 185, in stage1
    subprocess.check_call([builder.context.env_exe, __file__])
  File "/usr/lib/python3.4/subprocess.py", line 558, in check_call
    raise CalledProcessError(retcode, cmd)
subprocess.CalledProcessError: Command '['/home/sichen/openeis-master/env/bin/python3.4', 'bootstrap.py']' returned non-zero exit status 1

But in fact I do have pip with python3.6 and python2.7. Do I need to get other modules for python3.4?