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

Git Bash: Spyder's script has wrong shebang #1331

Closed
spyder-bot opened this issue Feb 17, 2015 · 21 comments
Closed

Git Bash: Spyder's script has wrong shebang #1331

spyder-bot opened this issue Feb 17, 2015 · 21 comments

Comments

@spyder-bot
Copy link
Collaborator

From bwanama...@gmail.com on 2013-03-24T18:51:58Z

Please note that reporting bugs from Spyder's help menu ("?" > "Report
issue...") will fill version details for Spyder, Python and Qt in this description for you.

What steps will reproduce the problem?

  1. open bash
    1. type spyder
    2. or try python \spyder What is the expected output? What do you see instead? expected: spyder runs
      observed:
      $ spyder
      sh.exe": /c/Python27/Scripts/spyder: D:\winpython\install\WinPython-64bit-2.7.3.
      3\python-2.7.3.amd64\python.exe^M: bad interpreter: No such file or directory What version of the product are you using? On what operating system? spyder-2.1.13.1-win-amd64.exe
      Python-2.7.3
      Windows XP 64-bit

Please provide any additional information below

. obviously replace python\scripts\spyder contents:
#!D:\winpython\install\WinPython-64bit-2.7.3.3\python-2.7.3.amd64\python.exe
from spyderlib import spyder
spyder.main()

with:
#!C:\Python27\python.exe
from spyderlib import spyder
spyder.main()

Original issue: http://code.google.com/p/spyderlib/issues/detail?id=1331

@spyder-bot
Copy link
Collaborator Author

From ccordoba12 on 2013-03-25T09:39:59Z

This seems more a problem with WinPython. I'm not sure but thanks for the report.

Owner: pierre.raybaut

@spyder-bot
Copy link
Collaborator Author

From bwanama...@gmail.com on 2013-03-25T10:40:01Z

Are you saying that the env for the shebang was determined locally during installation? I used spyder-2.1.13.1-win-amd64.exe installer from downloads. My machine has official Python-2.7.3 from python.org installed locally; I'm not using winpython. Spyderlib is the only installer that has created this "winpython" shebang. But maybe someone used winpython on my machine once in the past and left some config file lying around that spyderlib read instead of using Python-2.7.3 listed in windows registry? Bizarre.

@spyder-bot
Copy link
Collaborator Author

From ccordoba12 on 2013-04-11T11:32:19Z

I don't understand. Are you on Windows and using bash?

It seems that the problem comes from the fact that the executable you mention was generated with WinPython and so the main script gets and incorrect shebang (the one from the WinPython python exec).

Jed, could you take a look at this?

Cc: jed.lud...@gmail.com
Labels: OpSys-Windows Cat-SpyderGUI

@spyder-bot
Copy link
Collaborator Author

From bwanama...@gmail.com on 2013-04-11T12:14:01Z

I don't understand. Are you on Windows and using bash?

Yes, I am using Windows 7 x64 with Git Bash. I don't think this is an unusual use case, since a lot of Windows users are using Git, and the Git Bash is very nice compared to Windows CMD shell.

It seems that the problem comes from the fact that the executable you mention was
generated with WinPython and so the main script gets and incorrect shebang (the
one from the WinPython python exec).

That was kind of what I thought. Maybe when this release was packaged for windows, the packager was using WinPython, and so voila. Am I wrong about this? Are the scripts generated dynamically at install time (A), or is it hardcoded when it's packaged as a binary installer for windows, and just copied out to local directories when installed (B)?

If (A) then there is something very weird going on, because I have never, ever used WinPython.

If (B) then there should be separate installers for WinPython and Python installed using the official Windows installer from http://Python.org/getit .

@spyder-bot
Copy link
Collaborator Author

From jed.lud...@gmail.com on 2013-04-11T19:22:58Z

I know that Pierre has been working with the 2.1 release along with WinPython, and I suspect that the 'spyder' was temporarily modified to accommodate some development there and the installer was then built with that change in place. I'd have to defer to Pierre for the final word on that, though.

@spyder-bot
Copy link
Collaborator Author

From pierre.raybaut on 2013-04-14T03:58:10Z

No, actually I've never changed the shebang of Spyder's script. I believe that the shebang may be have been changed by pip or setuptools during the install process... but not by me, that's for sure.

@spyder-bot
Copy link
Collaborator Author

From bwanama...@gmail.com on 2013-04-14T13:14:45Z

I used the .exe installer, not pip and not setuptools.

@spyder-bot
Copy link
Collaborator Author

From pierre.raybaut on 2013-04-15T10:08:17Z

Oh ok, it must have been added automatically by distutils when building the installer. Strange... I'll take a look at it.

But it should not happen when using the standard Windows cmd shell as shebang is UNIX-specific, AFAIK.

Summary: Git Bash: Spyder's script has wrong shebang (was: spyder script has wrong shebang)
Status: Accepted
Labels: -Priority-Medium Priority-High MS-v2.2

@spyder-bot
Copy link
Collaborator Author

From bwanama...@gmail.com on 2013-04-15T10:12:41Z

Thanks for taking a look.
It does not happen in standard Windows cmd shell.
It only happens in Git Bash (a msys shell - emulates posix shell see http://msysgit.github.io/ ).

@spyder-bot
Copy link
Collaborator Author

From bwanama...@gmail.com on 2013-04-15T10:13:55Z

see my comment #4 ( https://code.google.com/p/spyderlib/issues/detail?id=1331#c4 ). I believe lots of windows users are using git bash.

@spyder-bot
Copy link
Collaborator Author

From ccordoba12 on 2013-04-24T09:18:13Z

I didn't know about Git bash, it seems very interesting. I thought you were running Spyder under Cygwin but it seemed a bit strange to me.

Jed, since you are going to generate the final installers for 2.2, could you take care of this issue too?

Owner: jed.lud...@gmail.com
Cc: -jed.lud...@gmail.com

@spyder-bot
Copy link
Collaborator Author

From jed.lud...@gmail.com on 2013-04-29T15:08:37Z

Labels: MS-v2.2.1

@spyder-bot
Copy link
Collaborator Author

From jed.lud...@gmail.com on 2013-04-29T15:10:06Z

Labels: -MS-v2.2

@spyder-bot
Copy link
Collaborator Author

From jed.lud...@gmail.com on 2013-05-31T13:42:51Z

I'm going to assume this was fixed by the 2.2.0 release since it's been out now for a bit, and the problem has not resurfaced. If I'm wrong, please re-open.

Status: Fixed

@spyder-bot
Copy link
Collaborator Author

From bwanama...@gmail.com on 2013-05-31T14:06:58Z

Thanks!

@spyder-bot
Copy link
Collaborator Author

From bwanama...@gmail.com on 2013-05-31T14:09:28Z

Can you please take a look at integrating the git scm.py patch in issue
1333 ? I think it's slated for 2.2.1. Can't wait to see it. Thanks!

@spyder-bot
Copy link
Collaborator Author

From bwanama...@gmail.com on 2013-06-03T10:35:38Z

Yes, I can confirm that the latest spyderlib (2.2.0) does not have this issue anymore. Thanks again for working on spyderlib and providing such really great support!
--mark

@spyder-bot
Copy link
Collaborator Author

From jed.lud...@gmail.com on 2013-06-03T15:12:40Z

Status: Verified

@spyder-bot
Copy link
Collaborator Author

From bwanama...@gmail.com on 2013-12-04T11:38:30Z

Spyder 2.2.5 again has this issue when installed using the installer for amd64-2.7 https://code.google.com/p/spyderlib/downloads/detail?name=spyder-2.2.5.win-amd64.exe&can=2&q= script is attached (from c:\python27\scripts):

it looks like this:

\#!D:\WinPython\install\WinPython-64bit-2.7.5.2\python-2.7.5.amd64\python.exe
from spyderlib import start_app
start_app.main()

obviously if started in a POSIX shell like Git-Bash or MSYS, it will fail:

$ spyder
sh.exe": /c/Python27/Scripts/spyder: D:\WinPython\install\WinPython-64bit-2.7.5.2\python-2.7.5.amd64\python.exe^M: bad interpreter: no medium

Attachment: spyder

@spyder-bot
Copy link
Collaborator Author

From bwanama...@gmail.com on 2014-10-28T08:59:54Z

Same issue now with Spyder-2.3.1, shebang for spyder.py now points to Miniconda. I guess if users are savvy enuf to use Git Bash then they can edit the shebang in spyder.py to say #! /usr/bin/env python altho it would be nice if that was just the standard, because it should work in POSIX environments.

@spyder-bot
Copy link
Collaborator Author

From ccordoba12 on 2014-10-28T17:45:14Z

We can't control the shebang used by Anaconda/Miniconda.

I really don't know what to do about this one. It seems like a minor use case to justify action from our side :)

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

1 participant