fyears / electron-python-example

Electron as GUI of Python Applications
MIT License
2k stars 234 forks source link

Update `package.json` for packaging as application #21

Open lzkelley opened 6 years ago

lzkelley commented 6 years ago

In the blog post, you have a section on creating a packaged application. I'm having some trouble getting it to work, however. Did you make any modifications to the package.json file? i.e. did you add an extraResources section to the build instructions so that electron-packager knows to include it? Thanks!

ChrisCruze commented 6 years ago

I'm also having trouble getting it to work. It works great when I remove pycalcdist. When I run the api executable by clicking on it, I get the following error

File "api.py", line 4, in <module> File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/PyInstaller/loader/pyimod03_importers.py", line 396, in load_module exec(bytecode, module.__dict__) File "site-packages/zerorpc/__init__.py", line 29, in <module> File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/PyInstaller/loader/pyimod03_importers.py", line 396, in load_module exec(bytecode, module.__dict__) File "site-packages/zerorpc/context.py", line 32, in <module> File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/PyInstaller/loader/pyimod03_importers.py", line 396, in load_module exec(bytecode, module.__dict__) File "site-packages/zerorpc/gevent_zmq.py", line 28, in <module> File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/PyInstaller/loader/pyimod03_importers.py", line 396, in load_module exec(bytecode, module.__dict__) File "site-packages/zmq/__init__.py", line 34, in <module> File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/PyInstaller/loader/pyimod03_importers.py", line 396, in load_module exec(bytecode, module.__dict__) File "site-packages/zmq/backend/__init__.py", line 40, in <module> File "site-packages/zmq/backend/__init__.py", line 27, in <module> File "site-packages/zmq/backend/select.py", line 26, in select_backend File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/PyInstaller/loader/pyimod03_importers.py", line 396, in load_module exec(bytecode, module.__dict__) File "site-packages/zmq/backend/cython/__init__.py", line 6, in <module> File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/PyInstaller/loader/pyimod03_importers.py", line 687, in load_module module = imp.load_module(fullname, fp, filename, ext_tuple) ImportError: dlopen(/Users/chriscruz/Desktop/Test3/electron-python-example/pycalcdist2/api/zmq.backend.cython.error.so, 2): Symbol not found: _zmq_errno Referenced from: /Users/chriscruz/Desktop/Test3/electron-python-example/pycalcdist2/api/zmq.backend.cython.error.so Expected in: flat namespace in /Users/chriscruz/Desktop/Test3/electron-python-example/pycalcdist2/api/zmq.backend.cython.error.so

fyears commented 6 years ago

Hi all, I am sorry that I haven't maintained the repo for some dates.

unable to package zeromq

(https://github.com/fyears/electron-python-example/issues/22 is the same issue I think. @asakiasako)

@lzkelley have you solved the issue yet? The point is, I had NOT updated the package.json but the method began to failed since some time... :-(

Although I wrote this in package.json:

  "devDependencies": {
    "electron": "^1.7.6",
    "electron-packager": "^9.0.1"
  }

I only tested on the exact versions at that time. Maybe it's possible to reproduce the successful packaging using the exact versions? Have you tried that?

I will look into the issue and try to update if possible in near future.

py error

On the other hand, @ChrisCruze's issue seemed to happen on python part instead of something about packaging. Can you successfully run the core functions only on python part by reading this? If not, maybe you want to reinstall the python library again.