Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to set Spyder as default program/app to open (.py) Python file?

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!

like image 888
user13985 Avatar asked Nov 16 '25 12:11

user13985


1 Answers

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.
like image 120
Shantanu Avatar answered Nov 19 '25 01:11

Shantanu



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!