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!

1
  • your question is different. Other questions address only windows. Macintosh is a different beast. Commented Jan 26, 2018 at 20:17

2 Answers 2

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.
Sign up to request clarification or add additional context in comments.

1 Comment

Is the duti step necessary? I skipped it and it seemed to work fine...?
-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

3 Comments

good call about giving the rundown, else it would have been a link only answer, which is bad.
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!
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.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.