3

How to set Spyder as default program for Python file? This question has been asked over and over in here and here. I looked around, there still isn't an answer.

I want to click on a .py file, and open it in Spyder. Instead of, opening Sypder from Terminal, then go to File > open. I'm using a Mac.

This question was asked as early as 2013. It's now 2018!

Jean-François Fabre
  • 137,073
  • 23
  • 153
  • 219
user13985
  • 221
  • 1
  • 10

2 Answers2

1

Steps:

  • Download the spyder-mac-app.zip archive. Unarchive it to /Applications
  • Edit the /Applications/Spyder.app/Contents/MacOS/Spyder file to launch the right environment of Spyder, e.g.:

    #!/bin/sh
    $HOME/anaconda3/envs/tensorflow/bin/spyder $@
    
  • Launch Spyder from Finder to verify that Finder is launching as expected.

  • Install duti and run duti -s org.spyder .py all
  • Right click any .py file in Finder, click Get Info In Open with menu, select Other and navigate to 'Applications. Select Spyder, Press Add and Click on Change All in Info menu.
Shantanu
  • 373
  • 2
  • 8
-3

Here is the rundown (seen here: Change Default App For File On Mac):

  1. Right Click File
  2. Click Get Info
  3. Click Open With Dropdown
  4. Choose The App
  5. Click Change All
  6. If Asked Click Continue
Jean-François Fabre
  • 137,073
  • 23
  • 153
  • 219
Binary111
  • 149
  • 4
  • 15
  • good call about giving the rundown, else it would have been a link only answer, which is bad. – Jean-François Fabre Jan 26 '18 at 20:18
  • 1
    It does not work. Spyder is not in in drop down menu in step 4. I even did: right clicked Python file > open with > other , and then, enable > All applications. Spyder is still in light gray. Does not work! – user13985 Jan 26 '18 at 22:58
  • Oh, sorry I don't use spyder I just thought it would be like most applications. I'll try to take a closer look today. – Binary111 Jan 29 '18 at 14:23