Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unable to Build Mac OS X Application #2209

Closed
0u812 opened this issue Feb 27, 2015 · 16 comments
Closed

Unable to Build Mac OS X Application #2209

0u812 opened this issue Feb 27, 2015 · 16 comments
Labels

Comments

@0u812
Copy link

0u812 commented Feb 27, 2015

I'm trying to build a self-contained Mac app by following these instructions:
https://bitbucket.org/spyder-ide/spyder-mac-app/src/8678bee94f6632753089949f165926164dadc8a0/Howto%20build%20the%20app.md?at=default
For the purposes of this issue, I'm using the official Spyder master branch at a67dfc9. Basically, I am interested in how the official Spyder dmg is currently being built. Are these instructions still current? As you can see, they don't work for me. I'm on Mavericks FWIW.

I've followed all of the instructions to the letter up to python setup.py build_doc, which fails with

error: [Errno 2] No such file or directory: 'build/lib/spyderlib/doc'

Furthermore, if I try to run

/usr/local/bin/python create_app.py py2app

(I need to use /usr/local/bin/python and not simply python because this is where pip installs its packages), the create_app.py script fails with

RuntimeError: maximum recursion depth exceeded while calling a Python object

The backtrace contains this:

  File "/usr/local/lib/python2.7/site-packages/modulegraph/modulegraph.py", line 924, in import_hook
    m = self._load_tail(q, tail)
  File "/usr/local/lib/python2.7/site-packages/modulegraph/modulegraph.py", line 1029, in _load_tail
    result = self._import_module(head, mname, result)
  File "/usr/local/lib/python2.7/site-packages/modulegraph/modulegraph.py", line 1105, in _import_module
    m = self._load_module(fqname, fp, pathname, stuff)
  File "/usr/local/lib/python2.7/site-packages/modulegraph/modulegraph.py", line 1178, in _load_module
    self._scan_code(co, m)
  File "/usr/local/lib/python2.7/site-packages/modulegraph/modulegraph.py", line 1251, in _scan_code
    self._scan_ast(co, m)
  File "/usr/local/lib/python2.7/site-packages/modulegraph/modulegraph.py", line 1260, in _scan_ast
    visitor.visit(co)
  File "/usr/local/Cellar/python/2.7.9/Frameworks/Python.framework/Versions/2.7/lib/python2.7/ast.py", line 241, in visit
    return visitor(node)
  File "/usr/local/Cellar/python/2.7.9/Frameworks/Python.framework/Versions/2.7/lib/python2.7/ast.py", line 249, in generic_visit
    self.visit(item)
  File "/usr/local/Cellar/python/2.7.9/Frameworks/Python.framework/Versions/2.7/lib/python2.7/ast.py", line 241, in visit
    return visitor(node)
  File "/usr/local/Cellar/python/2.7.9/Frameworks/Python.framework/Versions/2.7/lib/python2.7/ast.py", line 249, in generic_visit
    self.visit(item)
  File "/usr/local/Cellar/python/2.7.9/Frameworks/Python.framework/Versions/2.7/lib/python2.7/ast.py", line 241, in visit
    return visitor(node)
  File "/usr/local/lib/python2.7/site-packages/modulegraph/modulegraph.py", line 624, in visit_FunctionDef
    self.generic_visit(node)
  File "/usr/local/Cellar/python/2.7.9/Frameworks/Python.framework/Versions/2.7/lib/python2.7/ast.py", line 249, in generic_visit
    self.visit(item)
  File "/usr/local/Cellar/python/2.7.9/Frameworks/Python.framework/Versions/2.7/lib/python2.7/ast.py", line 241, in visit
    return visitor(node)

and then has many repeats of

  File "/usr/local/Cellar/python/2.7.9/Frameworks/Python.framework/Versions/2.7/lib/python2.7/ast.py", line 241, in visit
    return visitor(node)
  File "/usr/local/Cellar/python/2.7.9/Frameworks/Python.framework/Versions/2.7/lib/python2.7/ast.py", line 246, in generic_visit
    if isinstance(value, list):
@ccordoba12 ccordoba12 added this to the v2.3.4 milestone Feb 27, 2015
@ccordoba12
Copy link
Member

What version of py2app are you using?

@0u812
Copy link
Author

0u812 commented Feb 27, 2015

I'm using 0.9 (output of pip show py2app):

Name: py2app
Version: 0.9
Location: /usr/local/lib/python2.7/site-packages
Requires: altgraph, modulegraph, macholib

@ccordoba12
Copy link
Member

I'm using py2app 0.8 to build the app right now because I encountered this error myself (or something similar, I don't remember exactly ;-).

@0u812
Copy link
Author

0u812 commented Mar 2, 2015

Thanks, but unfortunately I got the same error even after downgrading to py2app 0.8. I was able to get past the recursion limit by adding

sys.setrecursionlimit(2000)

to setup.py, but now I'm running into the following error (with py2app 0.8):

Traceback (most recent call last):
  File "create_app.py", line 98, in <module>
    options={'py2app': OPTIONS}
  File "/usr/local/Cellar/python/2.7.9/Frameworks/Python.framework/Versions/2.7/lib/python2.7/distutils/core.py", line 151, in setup
    dist.run_commands()
  File "/usr/local/Cellar/python/2.7.9/Frameworks/Python.framework/Versions/2.7/lib/python2.7/distutils/dist.py", line 953, in run_commands
    self.run_command(cmd)
  File "/usr/local/Cellar/python/2.7.9/Frameworks/Python.framework/Versions/2.7/lib/python2.7/distutils/dist.py", line 972, in run_command
    cmd_obj.run()
  File "/usr/local/lib/python2.7/site-packages/py2app/build_app.py", line 651, in run
    self._run()
  File "/usr/local/lib/python2.7/site-packages/py2app/build_app.py", line 857, in _run
    self.run_normal()
  File "/usr/local/lib/python2.7/site-packages/py2app/build_app.py", line 928, in run_normal
    mf = self.get_modulefinder()
  File "/usr/local/lib/python2.7/site-packages/py2app/build_app.py", line 806, in get_modulefinder
    debug=debug,
  File "/usr/local/lib/python2.7/site-packages/modulegraph/find_modules.py", line 341, in find_modules
    find_needed_modules(mf, scripts, includes, packages)
  File "/usr/local/lib/python2.7/site-packages/modulegraph/find_modules.py", line 256, in find_needed_modules
    mf.import_hook(mod)
  File "/usr/local/lib/python2.7/site-packages/modulegraph/modulegraph.py", line 923, in import_hook
    q, tail = self._find_head_package(parent, name, level)
  File "/usr/local/lib/python2.7/site-packages/modulegraph/modulegraph.py", line 1007, in _find_head_package
    q = self._import_module(head, qname, parent)
  File "/usr/local/lib/python2.7/site-packages/modulegraph/modulegraph.py", line 1105, in _import_module
    m = self._load_module(fqname, fp, pathname, stuff)
  File "/usr/local/lib/python2.7/site-packages/modulegraph/modulegraph.py", line 1178, in _load_module
    self._scan_code(co, m)
  File "/usr/local/lib/python2.7/site-packages/modulegraph/modulegraph.py", line 1253, in _scan_code
    compile(co, '-', 'exec', 0, True), m)
  File "-", line 16
SyntaxError: from __future__ imports must occur at the beginning of the file

Any idea what the problem could be?

@ccordoba12
Copy link
Member

I think you need to use the exact modulegraph and other py2app
dependency versions required by 0.8 when it was released. I'll let you
know what versions I'm using tomorrow (because I don't have my Mac here :-)

El 01/03/15 a las 22:14, Kyle Medley escribió:

Thanks, but unfortunately I got the same error even after downgrading
to py2app 0.8. I was able to get past the recursion limit by adding

|sys.setrecursionlimit(2000)
|

to |setup.py|, but now I'm running into the following error (with
py2app 0.8):

|Traceback (most recent call last):
File "create_app.py", line 98, in
options={'py2app': OPTIONS}
File "/usr/local/Cellar/python/2.7.9/Frameworks/Python.framework/Versions/2.7/lib/python2.7/distutils/core.py", line 151, in setup
dist.run_commands()
File "/usr/local/Cellar/python/2.7.9/Frameworks/Python.framework/Versions/2.7/lib/python2.7/distutils/dist.py", line 953, in run_commands
self.run_command(cmd)
File "/usr/local/Cellar/python/2.7.9/Frameworks/Python.framework/Versions/2.7/lib/python2.7/distutils/dist.py", line 972, in run_command
cmd_obj.run()
File "/usr/local/lib/python2.7/site-packages/py2app/build_app.py", line 651, in run
self._run()
File "/usr/local/lib/python2.7/site-packages/py2app/build_app.py", line 857, in _run
self.run_normal()
File "/usr/local/lib/python2.7/site-packages/py2app/build_app.py", line 928, in run_normal
mf = self.get_modulefinder()
File "/usr/local/lib/python2.7/site-packages/py2app/build_app.py", line 806, in get_modulefinder
debug=debug,
File "/usr/local/lib/python2.7/site-packages/modulegraph/find_modules.py", line 341, in find_modules
find_needed_modules(mf, scripts, includes, packages)
File "/usr/local/lib/python2.7/site-packages/modulegraph/find_modules.py", line 256, in find_needed_modules
mf.import_hook(mod)
File "/usr/local/lib/python2.7/site-packages/modulegraph/modulegraph.py", line 923, in import_hook
q, tail = self._find_head_package(parent, name, level)
File "/usr/local/lib/python2.7/site-packages/modulegraph/modulegraph.py", line 1007, in _find_head_package
q = self._import_module(head, qname, parent)
File "/usr/local/lib/python2.7/site-packages/modulegraph/modulegraph.py", line 1105, in _import_module
m = self._load_module(fqname, fp, pathname, stuff)
File "/usr/local/lib/python2.7/site-packages/modulegraph/modulegraph.py", line 1178, in _load_module
self._scan_code(co, m)
File "/usr/local/lib/python2.7/site-packages/modulegraph/modulegraph.py", line 1253, in _scan_code
compile(co, '-', 'exec', 0, True), m)
File "-", line 16
SyntaxError: from future imports must occur at the beginning of the file
|

Any idea what the problem could be?


Reply to this email directly or view it on GitHub
#2209 (comment).

@0u812
Copy link
Author

0u812 commented Mar 2, 2015

Okay thanks!

@0u812
Copy link
Author

0u812 commented Mar 3, 2015

Any word on the correct versions?

@ccordoba12
Copy link
Member

  • py2app 0.8.1
  • altgraph 0.11
  • modulegraph 0.11.1
  • macholib 1.6

@0u812
Copy link
Author

0u812 commented Mar 3, 2015

Thanks, but I still run into the error below (and I still need to add sys.setrecursionlimit(2000) to setup.py to prevent hitting the maximum recursion depth). I'm using brew-installed Python 2.7.9. Could it be a Python version mismatch? Also, I did git pull to update Spyder to 9ae469c.

running py2app
creating /Users/phantom/devel/src/spyder-gh/build/bdist.macosx-10.9-x86_64/python2.7-standalone/app
creating /Users/phantom/devel/src/spyder-gh/build/bdist.macosx-10.9-x86_64/python2.7-standalone/app/collect
creating /Users/phantom/devel/src/spyder-gh/build/bdist.macosx-10.9-x86_64/python2.7-standalone/app/temp
creating build/bdist.macosx-10.9-x86_64/python2.7-standalone/app/lib-dynload
creating build/bdist.macosx-10.9-x86_64/python2.7-standalone/app/Frameworks
Traceback (most recent call last):
  File "create_app.py", line 98, in <module>
    options={'py2app': OPTIONS}
  File "/usr/local/Cellar/python/2.7.9/Frameworks/Python.framework/Versions/2.7/lib/python2.7/distutils/core.py", line 151, in setup
    dist.run_commands()
  File "/usr/local/Cellar/python/2.7.9/Frameworks/Python.framework/Versions/2.7/lib/python2.7/distutils/dist.py", line 953, in run_commands
    self.run_command(cmd)
  File "/usr/local/Cellar/python/2.7.9/Frameworks/Python.framework/Versions/2.7/lib/python2.7/distutils/dist.py", line 972, in run_command
    cmd_obj.run()
  File "/usr/local/lib/python2.7/site-packages/py2app/build_app.py", line 651, in run
    self._run()
  File "/usr/local/lib/python2.7/site-packages/py2app/build_app.py", line 857, in _run
    self.run_normal()
  File "/usr/local/lib/python2.7/site-packages/py2app/build_app.py", line 928, in run_normal
    mf = self.get_modulefinder()
  File "/usr/local/lib/python2.7/site-packages/py2app/build_app.py", line 806, in get_modulefinder
    debug=debug,
  File "/usr/local/lib/python2.7/site-packages/modulegraph/find_modules.py", line 341, in find_modules
    find_needed_modules(mf, scripts, includes, packages)
  File "/usr/local/lib/python2.7/site-packages/modulegraph/find_modules.py", line 256, in find_needed_modules
    mf.import_hook(mod)
  File "/usr/local/lib/python2.7/site-packages/modulegraph/modulegraph.py", line 923, in import_hook
    q, tail = self._find_head_package(parent, name, level)
  File "/usr/local/lib/python2.7/site-packages/modulegraph/modulegraph.py", line 1007, in _find_head_package
    q = self._import_module(head, qname, parent)
  File "/usr/local/lib/python2.7/site-packages/modulegraph/modulegraph.py", line 1105, in _import_module
    m = self._load_module(fqname, fp, pathname, stuff)
  File "/usr/local/lib/python2.7/site-packages/modulegraph/modulegraph.py", line 1178, in _load_module
    self._scan_code(co, m)
  File "/usr/local/lib/python2.7/site-packages/modulegraph/modulegraph.py", line 1253, in _scan_code
    compile(co, '-', 'exec', 0, True), m)
  File "-", line 16
SyntaxError: from __future__ imports must occur at the beginning of the file

Btw all packages now have correct versions:

$ pip show py2app altgraph modulegraph macholib
---
Name: py2app
Version: 0.8.1
Location: /usr/local/lib/python2.7/site-packages
Requires: altgraph, modulegraph, macholib
---
Name: altgraph
Version: 0.11
Location: /usr/local/lib/python2.7/site-packages
Requires:
---
Name: modulegraph
Version: 0.11.1
Location: /usr/local/lib/python2.7/site-packages
Requires: altgraph
---
Name: macholib
Version: 1.6
Location: /usr/local/lib/python2.7/site-packages
Requires: altgraph

@ccordoba12
Copy link
Member

No idea, I'm creating the app on 10.7 and it works fine here

@ccordoba12 ccordoba12 modified the milestones: v2.4, v2.3.4 Mar 3, 2015
@0u812
Copy link
Author

0u812 commented Mar 3, 2015

Oh well, thanks for your help anyway! Just one question before I close this - can you say which Python version you're using to run create_app.py and if it is installed via homebrew?

@ccordoba12
Copy link
Member

I'm using Python 2.7.8 at the moment. But please don't close this issue, I'll try to simplify this whole process by using Anaconda instead of Homebrew.

@ccordoba12
Copy link
Member

@0u812 I uploaded new dmg for Python 2 and Python 3 to our download site

https://bitbucket.org/spyder-ide/spyderlib/downloads

Would you mind to test if any of them work on 10.9.5? Thanks :-)

@0u812
Copy link
Author

0u812 commented Mar 10, 2015

Sure thing! But I'm traveling right now and have intermittent internet
access. Can't seem to get through to the downloads. I'll try again later.

On 3/9/15 9:15 PM, Carlos Cordoba wrote:

@0u812 https://github.com/0u812 I uploaded new dmg for Python 2 and
Python 3 to our download site

https://bitbucket.org/spyder-ide/spyderlib/downloads

Would you mind to test if any of them work on 10.9.5? Thanks :-)


Reply to this email directly or view it on GitHub
#2209 (comment).

@0u812
Copy link
Author

0u812 commented Mar 19, 2015

I'm finally back from traveling and I was able to test the new dmgs (sorry it took so long). I'm running 10.10 (Yosemite) now, and here's what I found:

  • Spyder with Python 3.4 works well except the IPython console. It just displays the "Connecting to kernel..." message with the spinning throbber. I let it go for about 10 min and it still didn't connect. Also tried opening new IPython console, restarting kernel - didn't help.
  • Spyder with Python 2.7 seems to work fine - no IPython trouble

Has anyone experienced this before? Should I file an issue?

@ccordoba12 ccordoba12 removed this from the v2.4 milestone Mar 23, 2015
@ccordoba12
Copy link
Member

Good! The problems with the IPython console are known. At least Spyder with Python 2.7 is working well now!

I'm closing this one because I don't think there is anything else to do.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants