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

Menubar doesn't work immediately when installing from git #3329

Closed
astrofrog opened this issue Jul 28, 2016 · 5 comments
Closed

Menubar doesn't work immediately when installing from git #3329

astrofrog opened this issue Jul 28, 2016 · 5 comments

Comments

@astrofrog
Copy link

astrofrog commented Jul 28, 2016

[I should preface this by saying that it is not a spyder bug, but a problem that both spyder and glueviz have and need to find a solution for, so I am opening this in the hope that you have ideas on how to fix it properly]

Steps to reproduce the issue on MacOS X:

  • conda create -n spyder-dev -c spyder-ide spyder
  • conda remove spyder --force
  • Install developer version of spyder
  • Open spyder

At this point, the menubar (File, Edit, etc.) is not responsive, and one needs to switch to a different application and then back for it to work.

This is an issue I've brought up with the conda developers here but with no satisfactory conclusion. This problem can actually be demonstrated with a simple python script:

from PyQt4.QtGui import QApplication, QMainWindow, QMenu

app = QApplication([''])
main = QMainWindow()
mbar = main.menuBar()
menu = QMenu(mbar)
menu.setTitle("&File")
mbar.addMenu(menu)
main.show()
main.raise_()
app.exec_()

which can then be run with:

python script.py

Note that one way to get it to work is to run the script with:

python.app script.py

The reason this is not an issue with the stable releases of spyder is that the interpreter for the spyder script is set correctly to be python.app in those cases:

#!/bin/bash /Users/tom/miniconda3/envs/spyder-dev-3/bin/python.app

but when installing from git, the interpreter is then set to:

#!/Users/tom/miniconda3/envs/dev35/bin/python

I was curious whether you are able to reproduce this, and if so whether you have ideas for a solution?

cc @goanpeca

@astrofrog astrofrog changed the title When installing development version, Menubar doesn't work immediately When installing development version, menubar doesn't work immediately Jul 28, 2016
@ccordoba12 ccordoba12 added this to the v3.0beta5 milestone Jul 28, 2016
@goanpeca goanpeca self-assigned this Jul 28, 2016
@ccordoba12
Copy link
Member

It seems this was caused because I was using an old version of conda-build to create our beta packages. I tried with the latest conda-build (1.21.14) and python.app is added correctly to the spyder script shebang :-)

@astrofrog
Copy link
Author

@ccordoba12 - just to be clear, this issue was not when installing conda package, but when installing from git directly using python setup.py install. Are you not able to reproduce that issue?

@ccordoba12 ccordoba12 modified the milestones: wishlist, v3.0beta5 Aug 22, 2016
@ccordoba12 ccordoba12 reopened this Aug 22, 2016
@ccordoba12 ccordoba12 modified the milestones: v3.1, wishlist Aug 22, 2016
@ccordoba12 ccordoba12 changed the title When installing development version, menubar doesn't work immediately Menubar doesn't work immediately when installing with pip or from git Aug 22, 2016
@ccordoba12
Copy link
Member

I thought you were talking about our conda packages :-) Yes, I can reproduce this problem and to solve it we need to use pythonw instead of python in our scripts.

@ccordoba12 ccordoba12 changed the title Menubar doesn't work immediately when installing with pip or from git Menubar doesn't work immediately when installing from git Aug 22, 2016
@ccordoba12 ccordoba12 modified the milestones: wishlist, v3.1 Aug 22, 2016
@ccordoba12
Copy link
Member

However, I think this is a minor problem because most of the core devs use this command to run Spyder from git:

python bootstrap.py

issued from the root of our repo. And in Mac this command needs to be changed to

pythonw bootstrap.py

@goanpeca goanpeca removed their assignment Jan 14, 2017
@ccordoba12 ccordoba12 removed this from the wishlist milestone Jul 9, 2019
@ccordoba12
Copy link
Member

Closing because this no longer applies.

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

No branches or pull requests

3 participants