webrecorder / webrecorder-player

Webrecorder Player for Desktop (OSX/Windows/Linux). (Built with Electron + Webrecorder)
Apache License 2.0
426 stars 39 forks source link

Build Error #16

Closed edsu closed 7 years ago

edsu commented 7 years ago

Hi there, I'm just trying to build webrecorder-electron for the first time and am noticing an error:

6863 INFO: Loading module hook "hook-webrecorder.py"...
Traceback (most recent call last):
  File "/usr/local/bin/pyinstaller", line 11, in <module>
    sys.exit(run())
  File "/usr/local/lib/python2.7/site-packages/PyInstaller/__main__.py", line 90, in run
    run_build(pyi_config, spec_file, **vars(args))
  File "/usr/local/lib/python2.7/site-packages/PyInstaller/__main__.py", line 46, in run_build
    PyInstaller.building.build_main.main(pyi_config, spec_file, **kwargs)
  File "/usr/local/lib/python2.7/site-packages/PyInstaller/building/build_main.py", line 788, in main
    build(specfile, kw.get('distpath'), kw.get('workpath'), kw.get('clean_build'))
  File "/usr/local/lib/python2.7/site-packages/PyInstaller/building/build_main.py", line 734, in build
    exec(text, spec_namespace)
  File "<string>", line 16, in <module>
  File "/usr/local/lib/python2.7/site-packages/PyInstaller/building/build_main.py", line 212, in __init__
    self.__postinit__()
  File "/usr/local/lib/python2.7/site-packages/PyInstaller/building/datastruct.py", line 161, in __postinit__
    self.assemble()
  File "/usr/local/lib/python2.7/site-packages/PyInstaller/building/build_main.py", line 470, in assemble
    module_hook.post_graph()
  File "/usr/local/lib/python2.7/site-packages/PyInstaller/building/imphook.py", line 409, in post_graph
    self._load_hook_module()
  File "/usr/local/lib/python2.7/site-packages/PyInstaller/building/imphook.py", line 376, in _load_hook_module
    self.hook_module_name, self.hook_filename)
  File "/Users/ed/Projects/webrecorderplayer-electron/build.standalone/webrecorder/webrecorder/webrecorder/standalone/hooks/hook-webrecorder.py", line 4, in <module>
    from webrecorder.standalone.assetsutils import build, get_version_str
  File "/Users/ed/Projects/webrecorderplayer-electron/build.standalone/webrecorder/webrecorder/webrecorder/standalone/assetsutils.py", line 2, in <module>
    from webassets.script import GenericArgparseImplementation
ImportError: No module named webassets.script
~/Projects/webrecorderplayer-electron/build.standalone/webrecorder/webrecorder
cp: webrecorder/standalone/dist/webrecorder_player: No such file or directory

It seems like this causes the player to fail to start the Python binary?

screen shot 2017-03-30 at 11 38 57 am

atomotic commented 7 years ago

we used pyinstaller with python 3.4 or 3.5, never tested on 2.7. documentation still needs some adjustments. in the meanwhile you can download this prebuilt binary from travis-ci and save into ./python-binaries/webrecorder(don't forget chmod +x)

a github release will follow very soon

edsu commented 7 years ago

Ah, good catch. I see now that build-macos.sh is throwing off this error:

The path python3.5 (from --python=python3.5) does not exist

FWIW I updated updated the virtualenv creation to use 3.6 (which I have):

virtualenv -p python3.6 venv && source venv/bin/activate

and now I see:

75 INFO: Analyzing base_library.zip ...
Traceback (most recent call last):
  File "/Users/ed/Projects/webrecorderplayer-electron/build.standalone/venv/bin/pyinstaller", line 11, in <module>
    sys.exit(run())
  File "/Users/ed/Projects/webrecorderplayer-electron/build.standalone/venv/lib/python3.6/site-packages/PyInstaller/__main__.py", line 90, in run
    run_build(pyi_config, spec_file, **vars(args))
  File "/Users/ed/Projects/webrecorderplayer-electron/build.standalone/venv/lib/python3.6/site-packages/PyInstaller/__main__.py", line 46, in run_build
    PyInstaller.building.build_main.main(pyi_config, spec_file, **kwargs)
  File "/Users/ed/Projects/webrecorderplayer-electron/build.standalone/venv/lib/python3.6/site-packages/PyInstaller/building/build_main.py", line 788, in main
    build(specfile, kw.get('distpath'), kw.get('workpath'), kw.get('clean_build'))
  File "/Users/ed/Projects/webrecorderplayer-electron/build.standalone/venv/lib/python3.6/site-packages/PyInstaller/building/build_main.py", line 734, in build
    exec(text, spec_namespace)
  File "<string>", line 16, in <module>
  File "/Users/ed/Projects/webrecorderplayer-electron/build.standalone/venv/lib/python3.6/site-packages/PyInstaller/building/build_main.py", line 212, in __init__
    self.__postinit__()
  File "/Users/ed/Projects/webrecorderplayer-electron/build.standalone/venv/lib/python3.6/site-packages/PyInstaller/building/datastruct.py", line 161, in __postinit__
    self.assemble()
  File "/Users/ed/Projects/webrecorderplayer-electron/build.standalone/venv/lib/python3.6/site-packages/PyInstaller/building/build_main.py", line 317, in assemble
    excludes=self.excludes, user_hook_dirs=self.hookspath)
  File "/Users/ed/Projects/webrecorderplayer-electron/build.standalone/venv/lib/python3.6/site-packages/PyInstaller/depend/analysis.py", line 560, in initialize_modgraph
    graph.import_hook(m)
  File "/Users/ed/Projects/webrecorderplayer-electron/build.standalone/venv/lib/python3.6/site-packages/PyInstaller/lib/modulegraph/modulegraph.py", line 1509, in import_hook
    source_package, target_module_partname, level)
  File "/Users/ed/Projects/webrecorderplayer-electron/build.standalone/venv/lib/python3.6/site-packages/PyInstaller/lib/modulegraph/modulegraph.py", line 1661, in _find_head_package
    target_module_headname, target_package_name, source_package)
  File "/Users/ed/Projects/webrecorderplayer-electron/build.standalone/venv/lib/python3.6/site-packages/PyInstaller/depend/analysis.py", line 209, in _safe_import_module
    module_basename, module_name, parent_package)
  File "/Users/ed/Projects/webrecorderplayer-electron/build.standalone/venv/lib/python3.6/site-packages/PyInstaller/lib/modulegraph/modulegraph.py", line 2077, in _safe_import_module
    module_name, file_handle, pathname, metadata)
  File "/Users/ed/Projects/webrecorderplayer-electron/build.standalone/venv/lib/python3.6/site-packages/PyInstaller/lib/modulegraph/modulegraph.py", line 2167, in _load_module
    self._scan_code(m, co, co_ast)
  File "/Users/ed/Projects/webrecorderplayer-electron/build.standalone/venv/lib/python3.6/site-packages/PyInstaller/lib/modulegraph/modulegraph.py", line 2585, in _scan_code
    module, module_code_object, is_scanning_imports=False)
  File "/Users/ed/Projects/webrecorderplayer-electron/build.standalone/venv/lib/python3.6/site-packages/PyInstaller/lib/modulegraph/modulegraph.py", line 2831, in _scan_bytecode
    global_attr_name = get_operation_arg_name()
  File "/Users/ed/Projects/webrecorderplayer-electron/build.standalone/venv/lib/python3.6/site-packages/PyInstaller/lib/modulegraph/modulegraph.py", line 2731, in get_operation_arg_name
    return module_code_object.co_names[co_names_index]
IndexError: tuple index out of range
~/Projects/webrecorderplayer-electron/build.standalone/webrecorder/webrecorder
cp: webrecorder/standalone/dist/webrecorder_player: No such file or directory
atomotic commented 7 years ago

Python 3.6 is not yet supported by pyinstaller https://github.com/pyinstaller/pyinstaller/pull/2341

ikreymer commented 7 years ago

Yeah, we've been running with Python 3.5 currently. Do you want to try with 3.5?

edsu commented 7 years ago

It obviously works with 3.5 -- congrats on the release! -- so I'll close this.

edsu commented 7 years ago

I'm actually having some trouble with python3.5 as well on my Mac using python3.5-dev installed with pyenv.

32193 INFO: Python library not in binary depedencies. Doing additional searching...
Traceback (most recent call last):
  File "/Users/ed/.pyenv/versions/webrecorderplayer/bin/pyinstaller", line 11, in <module>
    load_entry_point('PyInstaller==3.2.1', 'console_scripts', 'pyinstaller')()
  File "/Users/ed/.pyenv/versions/3.5-dev/envs/webrecorderplayer/lib/python3.5/site-packages/PyInstaller/__main__.py", line 90, in run
    run_build(pyi_config, spec_file, **vars(args))
  File "/Users/ed/.pyenv/versions/3.5-dev/envs/webrecorderplayer/lib/python3.5/site-packages/PyInstaller/__main__.py", line 46, in run_build
    PyInstaller.building.build_main.main(pyi_config, spec_file, **kwargs)
  File "/Users/ed/.pyenv/versions/3.5-dev/envs/webrecorderplayer/lib/python3.5/site-packages/PyInstaller/building/build_main.py", line 788, in main
    build(specfile, kw.get('distpath'), kw.get('workpath'), kw.get('clean_build'))
  File "/Users/ed/.pyenv/versions/3.5-dev/envs/webrecorderplayer/lib/python3.5/site-packages/PyInstaller/building/build_main.py", line 734, in build
    exec(text, spec_namespace)
  File "<string>", line 16, in <module>
  File "/Users/ed/.pyenv/versions/3.5-dev/envs/webrecorderplayer/lib/python3.5/site-packages/PyInstaller/building/build_main.py", line 212, in __init__
    self.__postinit__()
  File "/Users/ed/.pyenv/versions/3.5-dev/envs/webrecorderplayer/lib/python3.5/site-packages/PyInstaller/building/datastruct.py", line 161, in __postinit__
    self.assemble()
  File "/Users/ed/.pyenv/versions/3.5-dev/envs/webrecorderplayer/lib/python3.5/site-packages/PyInstaller/building/build_main.py", line 543, in assemble
    self._check_python_library(self.binaries)
  File "/Users/ed/.pyenv/versions/3.5-dev/envs/webrecorderplayer/lib/python3.5/site-packages/PyInstaller/building/build_main.py", line 626, in _check_python_library
    raise IOError(msg)
OSError: Python library not found: libpython3.5.dylib, .Python, Python, libpython3.5m.dylib
This would mean your Python installation doesn't come with proper library files.
This usually happens by missing development package, or unsuitable build parameters of Python installation.

* On Debian/Ubuntu, you would need to install Python development packages
  * apt-get install python3-dev
  * apt-get install python-dev
* If you're building Python by yourself, please rebuild your Python with `--enable-shared` (or, `--enable-framework` on Darwin)

Is there a better way to build on Mac without installing 3.5 globally? Or are you mostly building on Linux?

atomotic commented 7 years ago

install python with pyenv this way:

PYTHON_CONFIGURE_OPTS="--enable-shared" pyenv install 3.5.3;

we had the same issue with travis-ci

edsu commented 7 years ago

Success!

screen shot 2017-03-31 at 2 26 19 pm

Btw, are installers for OS X and Windows available anywhere yet?

ikreymer commented 7 years ago

Installers? Do you mean the latest release? You can download it here :) https://github.com/webrecorder/webrecorderplayer-electron/releases/latest

We officially released 1.0.0 yesterday: https://twitter.com/webrecorder_io/status/847573532728975361

edsu commented 7 years ago

Ahh yes, I just found it myself by clicking on Releases thanks!