Spyder: Cant make Spyder default opening program for .py files

Created on 14 Dec 2016  Â·  14Comments  Â·  Source: spyder-ide/spyder

Since installing Winpython-64bit-3.5.2.3Qt5, I have been unable to open .py files by double clicking on them, using spyder as the default program.

What steps will reproduce the problem?**
When I right click a .py file and select properties, then where it says "Opens with:" I click the "Change" button and the "Open with" window appears. I click "Browse" and browse for the Spyder.exe in the winpython folder and click it and click open. It simply returns to the "Open with" window but doesnt show spyder in the list of programs.

I also thought to make an association with spyder and .py files from the Programs and Features list from the control panel, but spyder doesnt appear in the list of installed programs.

Opening Spyder by double clicking Spyder.exe in the winpython folder works fine and I can open .py files from within spyder.

I have never had this particular issue with previous winpython downloads

  • Spyder Version: spyder 3.1.0
  • Python Version: Python 3.5
  • Operating system: windows 7
future

All 14 comments

@stonebig, could you help here?

I never tried this way of opening. I may have a test myself.

Anyway the spyder.exe that @jcbalmer looks for should be something like "C:\users\jcbalmer\Documents\winpython-64bit-3.5.2.3\Spyder.exe" , so @jcbalmer must look for the 3rd layer of option of this "windows" dialog, where it let you search anywhere on your disk

apparently, it works, at least on curent 3.5.3.0 beta6, and probably on Winpython-64bit-3.5.2.3Qt5 . nice.

I am having a similar issue. When I tried to select the default program for Windows 7 to use, I selected spyder.exe here:

C:\Users[myname]\AppData\Local\Continuum\Anaconda3\Scripts\Spyder.exe

However after doing that, I just get an open completely blank console window, and nothing else happens.

Suspiciously, if I look at the properties of my Spyder shortcut from the start menu, it doesn't refer to any executable. It's a long Python target (all on one line):

C:\Users\sdewey\AppData\Local\Continuum\Anaconda3\pythonw.exe C:\Users\sdewey\AppData\Local\Continuum\Anaconda3\cwp.py C:\Users\sdewey\AppData\Local\Continuum\Anaconda3 "C:/Users/sdewey/AppData/Local/Continuum/Anaconda3/pythonw.exe" "C:/Users/sdewey/AppData/L

This is more suspicious because as you can see it's actually cut off (probably from the maximum target name length in Windows 7). Spyder seems to work fine from this shortcut, however.

Any suggestions to get it working using Spyder as the default program for .py files?

I'm having the same issue as @eliot1785 above - is there a solution for this yet?

I have the same issue. This is the type of issue that may force me to switch to a different IDE. Hopefully this add this functionality soon.

Found a solution using a bat file. I think basically all the links in the "shortcut" part need to be opened at the same time.

Hopefully they build something more intuitive.

Solution:
https://stackoverflow.com/questions/24643474/set-spyder-as-default-python/42282994#42282994

Screenshots attached.
Spyder BAT 2

Do like the screenshot and then, right click the file and navigate to the bat file to open it with.

Thank you! That worked perfectly.

@alochen , now I can't get it to work. I found that when I right click on the file and select the .bat file (pictured above), Spyder opens, but the file I selected doesn't actually open. When you tried this, did the actual file you right clicked on open? If so, can you take some screenshots?

Hi, yes when I right click on the file it opens Spyder directly. The file type it lists is 'PY file' if that makes a difference (see screenshot). I've also taken a screenshot of my spyder batch file just in case. I noticed in your screenshot, your notepad file (which I'm assuming is your batch file) doesn't have 'start' at the beginning or the '%1' at the end, as in the stackoverflow answer you linked - could that be it?
Capture_filetype
Capture_batch1
Capture_batch2

@alochen ,

You are correct. After I made the updates you pointed it, it worked!

I'm glad we solved this. I am trying to give back to the community (I'm new to programming), so I was surprised anyone even responded. You must have some notifications or something.

I liked how you used notepad++, which made it easy to see the "start" and "%1" tokens. I missed this with notepad.

Thanks!

@Joel-Balmer

How do we close issues? I have never had the pleasure of doing this before. Maybe @Joel-Balmer has to commission it.

Although we can't fix this directly, we plan to implement this at some point for Anaconda.

Good call. I literally almost decided to not use spyder because of this
issue, so I think it's an urgent request. It may be costing you users.

On Tue, Jan 14, 2020, 2:24 PM Carlos Cordoba notifications@github.com
wrote:

Although we can't fix this directly, we plan to implement this at some
point for Anaconda.

—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub
https://github.com/spyder-ide/spyder/issues/3835?email_source=notifications&email_token=AELD2UR5CEN76XGQMCOQ4ALQ5YNPZA5CNFSM4CZRUYVKYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOEI572ZQ#issuecomment-574356838,
or unsubscribe
https://github.com/notifications/unsubscribe-auth/AELD2URAFK4PDLRVXSG7NHTQ5YNPZANCNFSM4CZRUYVA
.

Was this page helpful?
0 / 5 - 0 ratings