Consensys / web3studio-soy

Static Websites on the Distributed Web
https://medium.com/web3studio/soy-is-the-secret-sauce-for-the-unstoppable-web-6e2c1f37430b
33 stars 5 forks source link

Trying to setup Soy locally #35

Closed brian-lc closed 5 years ago

brian-lc commented 5 years ago

Soy setup

Python 3.7 for keccak? Node 8 NPM Yarn Truffle

Keccak bindings compilation fail. Installed pyenv, then python 3.7

python 3 install failed due to...

brian@BCSurf2:~/DevWork/web3studio-soy$ pyenv install 3.7.2
Downloading Python-3.7.2.tar.xz...
-> https://www.python.org/ftp/python/3.7.2/Python-3.7.2.tar.xz
Installing Python-3.7.2...

BUILD FAILED (Ubuntu 18.04 using python-build 20180424)

Inspect or clean up the working tree at /tmp/python-build.20190108115541.3798
Results logged to /tmp/python-build.20190108115541.3798.log

Last 10 log lines:
    sys.exit(ensurepip._main())
  File "/tmp/python-build.20190108115541.3798/Python-3.7.2/Lib/ensurepip/__init__.py", line 204, in _main
    default_pip=args.default_pip,
  File "/tmp/python-build.20190108115541.3798/Python-3.7.2/Lib/ensurepip/__init__.py", line 117, in _bootstrap
    return _run_pip(args + [p[0] for p in _PROJECTS], additional_paths)
  File "/tmp/python-build.20190108115541.3798/Python-3.7.2/Lib/ensurepip/__init__.py", line 27, in _run_pip
    import pip._internal
zipimport.ZipImportError: can't decompress data; zlib not available
Makefile:1130: recipe for target 'install' failed
make: *** [install] Error 1

ran install for zlib1g-dev

That ran successfully, re-ran python instal. Got new error.

brian@BCSurf2:~/DevWork/web3studio-soy$ pyenv install 3.7.2
Downloading Python-3.7.2.tar.xz...
-> https://www.python.org/ftp/python/3.7.2/Python-3.7.2.tar.xz
Installing Python-3.7.2...

BUILD FAILED (Ubuntu 18.04 using python-build 20180424)

Inspect or clean up the working tree at /tmp/python-build.20190108121003.15984
Results logged to /tmp/python-build.20190108121003.15984.log

Last 10 log lines:
  File "/tmp/tmpwq9yk27x/pip-18.1-py2.py3-none-any.whl/pip/_internal/commands/__init__.py", line 6, in <module>
  File "/tmp/tmpwq9yk27x/pip-18.1-py2.py3-none-any.whl/pip/_internal/commands/completion.py", line 6, in <module>
  File "/tmp/tmpwq9yk27x/pip-18.1-py2.py3-none-any.whl/pip/_internal/cli/base_command.py", line 18, in <module>
  File "/tmp/tmpwq9yk27x/pip-18.1-py2.py3-none-any.whl/pip/_internal/download.py", line 38, in <module>
  File "/tmp/tmpwq9yk27x/pip-18.1-py2.py3-none-any.whl/pip/_internal/utils/glibc.py", line 3, in <module>
  File "/tmp/python-build.20190108121003.15984/Python-3.7.2/Lib/ctypes/__init__.py", line 7, in <module>
    from _ctypes import Union, Structure, Array
ModuleNotFoundError: No module named '_ctypes'
Makefile:1130: recipe for target 'install' failed
make: *** [install] Error 1

Known issue... apparently https://bugs.python.org/issue31652

Installed libffi-dev package, tried re-install . Got new errors

brian@BCSurf2:~/DevWork/web3studio-soy$ pyenv install 3.7.2
Downloading Python-3.7.2.tar.xz...
-> https://www.python.org/ftp/python/3.7.2/Python-3.7.2.tar.xz
Installing Python-3.7.2...
WARNING: The Python bz2 extension was not compiled. Missing the bzip2 lib?
WARNING: The Python readline extension was not compiled. Missing the GNU readline lib?
ERROR: The Python ssl extension was not compiled. Missing the OpenSSL lib?

Installing libssl-dev, libreadline-dev, bzip2

barlock commented 5 years ago

It looks like keccak uses a pure js implementation if you don't have python installed https://github.com/cryptocoinjs/keccak/blob/master/package.json#L3?

So I think that's a false positive?

You do need to use yarn instead of npm for installs. I'm writing a contributing doc to explain all this. I'll leave a note about python as an optional dep